【发布时间】:2018-03-10 00:26:33
【问题描述】:
我在理解为什么 PostgreSQL 给我 SQL 错误时遇到了一些麻烦:
ERROR: operator does not exist: character varying = integer
LINE 4: WHERE public.prospect.rating IN (1,2);
^
HINT: No operator matches the given name and argument type(s). You
might need to add explicit type casts.
SQL state: 42883
Character: 279
这是我正在使用的代码行:
SELECT public.people.organization, public.people.firstname,
public.people.lastname,
public.people.linkedinurl, public.people.orgcrunchbaseurl
FROM public.prospect LEFT JOIN public.people ON
public.prospect.organization = public.people.organization
WHERE public.prospect.rating BETWEEN 1 and 2;
我遇到的问题在最后一行。我也试过:
WHERE public.prospect.rating IN (1,2);
我正在尝试将搜索范围缩小到只有 1 或 2 评级的项目。
提前感谢您的帮助!
【问题讨论】:
标签: sql database postgresql operators