我在Postgres中使用Bitwise运算符时遇到问题我收到以下错误消息
ERROR: argument of WHERE must be type boolean, not type integer
我的查询如下所示
SELECT DISTINCT number,name,contact,special FROM clients WHERE special & 2048;
任何帮助将不胜感激
答案 0 :(得分:24)
您需要进行比较:
SELECT DISTINCT number, ..., special FROM clients WHERE special & 2048 = 2048;
或
SELECT DISTINCT number, ..., special FROM clients WHERE special & 2048 > 0;