sql - 错误 : operator does not exist: integer == integer

标签 sql postgresql

<分区>

我在 postgres 函数中使用这些语句。

Select count(*) into V_check
from employee
where employee_name like 'Raj%';

if V_check == 0
then
     update exception set exception_found = 'Raj';
end if;

我收到这个错误:

ERROR:  operator does not exist: integer == integer
LINE 1: SELECT V_check == 0

最佳答案

您应该使用 = 而不是 ==

以下是您可以使用的不同比较运算符的列表:

Operator    Description
=   Equal
<>  Not equal. Note: In some versions of SQL this operator may be written as !=
>   Greater than
<   Less than
>=  Greater than or equal
<=  Less than or equal
BETWEEN Between an inclusive range
LIKE    Search for a pattern
IN  To specify multiple possible values for a column

关于sql - 错误 : operator does not exist: integer == integer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47128528/

相关文章:

postgresql - PostgreSQL 中 && 运算符的时间复杂度

sql - MySQL:根据关联的ID限制输出

sql - 使用数据库/sql 包创建通用代码?

sql - 统计SQL查询记录数

sql - 同时订购两个 string_agg

linux - Ambari服务器无法启动

java - 如何在 JDBI 3 中使用列表绑定(bind) Bean 参数

php - PHP根据当前时间从数据库获取数据

javascript - 使用 NestJS 将文件存储在 PostgreSQL 数据库中

mysql - 在 MySQL 中存储 0.5