java - Postgres 查询必须是 boolean 类型

标签 java postgresql jdbi

我正在使用 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/

相关文章:

Java + MySQL + 内联用户变量 : Same query works in SQL editor, JDBD 中的错误结果 (org.skife.jdbi)

mysql - JDBI json 响应 o MySql 数据库

Java AES 字符串加密/解密

java - 为什么显示 "No database Selected"SQLException

java - 使用 ArrayList 和循环计算文本文件中的标点符号无法正常工作,如何解决?

Spring 安全 : java. lang.ClassNotFoundException : org. springframework.dao.support.DaoSupport

java - Map<Object, List<Object>>的组合

java - 获取 hibernate 中实体的最后一个ID

php - 如何将日期范围选择器的值传递给 SQL?

java - 您可以使用 JDBI、@BindBean、@SqlQuery 注释调用对象上的方法吗?