【发布时间】:2019-07-15 10:53:43
【问题描述】:
我正在使用本机查询从 PostgreSQL 获取分页结果,我使用了这个查询,我得到了以下异常:
SELECT a.*
FROM table1 a LEFT OUTER JOIN table2 b ON a.clmn1 = b.clmn1
WHERE (a.clmn3 = ?3 OR a.clmn4 ISNULL)
ORDER BY a.clmn1 DESC offset = ?1 limit = ?2
查询:
@Query(nativeQuery = true, value="select a.* from table1 a left outer join table2 b ON a.clmn1 = b.clmn1 where (a.clmn3= ?3 OR a.clmn4 isnull) order by a.clmn1 desc offset = ?1 limit = ?2")
public List<Result> getResults(int offset, int limit, int value);
例外:
org.postgresql.util.PSQLException: ERROR: syntax error at or near "="
请提出建议。
【问题讨论】:
-
你在 is 和 null 之间缺少一个空格..
-
不是同样的问题
-
重组了上面的查询,指出“is”和“null”之间缺少空格...
OR a.clmn4 ISNULL
标签: java postgresql spring-data-jpa eclipselink nativequery