2017-07-24 69 views
1

我正在使用skife來幫助我處理數據庫查詢。我有下面的查詢和方法。Postgres查詢必須是布爾類型

@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成功返回結果。

我錯過了什麼?

+0

解析它放置在\\操作<前一個布爾 – ja08prat

+0

@ ja08prat是什麼意思呢?對不起,我很抱歉。 – MaxPower

+1

在'<'運營商 – MinMiguelM

回答

1

感謝MinMiguelM

我需要

+0

什麼是背景? –

+1

更新到JDBI 2.x的最新版本 - 這應該修復< and >的錯誤解析。 – qualidafial

相關問題