转载:https://zhidao.baidu.com/question/1371256060978472579.html
PostgreSQL sql问题,操作符不存在
[SQL]select distinct o from pub_dict o,pub_role e where o.code=e.role_type and e.isValid=1 and o.type='002'
[Err] 错误: 操作符不存在: character = integer
LINE 1: ...,pub_role e where o.code=e.role_type and e.isValid=1 and o.t...
^
HINT: 没有匹配指定名称和参数类型的操作符. 您也许需要增加明确的类型转换.
答案:
错误提示的意思是没有对character和integer类型的值进行比较的操作符。也就是说在where条件中有等于号两边的类型不同,一个为charcter,一个为interger。如果需要比较的话,需要转换成同类型的值(比如转换成character或转换成integer)再做比较。