我的查询是这样的。我尝试获取 ID 列表的状态。
select order_number, order_status_name
from data.order_fact s
join data.order_status_dim l
on s.order_status_key = l.order_status_key
where
order_number in (1512011196169,1512011760019,1512011898493,1512011972111)
虽然我得到了一个错误:
ERROR: operator does not exist: character varying = bigint
LINE 6: order_number in (1512011196169,1512011760019,1512011898493,1...
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
关于我应该如何修改 ID 以使其正常工作,您是否有任何线索? 非常感谢!
最佳答案
您的 order_number
是一个 varchar,您不能将它与数字进行比较(123
在 SQL 中是一个数字,'123'
是一个字符串常量)
您需要使用字符串文字:
order_number in ('1512011196169','1512011760019','1512011898493','1512011972111')
手册中的更多详细信息:
http://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-CONSTANTS
关于postgresql - Postgres : ERROR: operator does not exist: character varying = bigint,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34740652/