postgresql - Postgres 数学 : Operator does not exist: bigint == integer

标签 postgresql

我有以下sql:

create table gps (laf int, "timestamp" timestamp);
select * from 
  (select *, row_number() over() from gps) as yo
where row_number == 10

但它会产生这样的响应:

ERROR: operator does not exist: bigint == integer Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts. Position: 84

类型转换似乎没有帮助。如何将 row_number(bigint)与数字进行比较?

最佳答案

似乎我陷入了编程领域,我需要 = 而不是 ==,但在这里发布是为了后代和谷歌:

select * from 
  (select *, row_number() over() from gps) as yo
where row_number = 0

关于postgresql - Postgres 数学 : Operator does not exist: bigint == integer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69680836/

相关文章:

postgresql - 使用 PostgreSQL JDBC 连接 URL 中/etc/hosts 中的条目

python - 关于postgresql序列的问题

sql - 如何编写 SQL 以在满足条件时返回一行,否则返回另一行

ruby - `clear_transaction_record_state' : undefined method `[]' for nil:NilClass when creating a record Ruby

sql - 检测具有相同 ID 的行之间的变化

postgresql - 检测 current_query() 是否是准备好的语句的干净方法?

postgresql - 如何使用内连接更新两个表中的多个字段

sql - 如何在 PostgreSQL 查询中显示行号?

sql - PostgreSQL:查询包含一个季度的最后时刻的 tstzrange

postgresql - PSQLException : The column name clazz_ was not found in this ResultSet