我正在使用 skife 来帮助我进行数据库查询。我有下面的查询和方法。
@SqlQuery("select * from profile where profile_id >= :from and profile_id < :to")
List<Profile> findAllInRange(@Bind("from")int from, @Bind("to")int to);
我得到以下错误
org.postgresql.util.PSQLException: ERROR: argument of AND must be type boolean, not type bigint
但是如果我执行这个查询
select * from profile where profile_id >= 1 and profile_id < 50
我的 RDBMS 成功返回结果。
我错过了什么?
最佳答案
归功于 MinMiguelM
我需要放置 \\
在 <
之前运算符
关于java - Postgres 查询必须是 boolean 类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45287455/