Reputation: 1512
so...
following loooong query
@Query(value = "SELECT A, B ... FROM ADMIN.SUPER_SEARCH WHERE A = :param OR B = :param ORDER BY A desc", nativeQuery = true )
will work just fine (i replaced few fields with ... it is a looong query)
but as soon as i add LIMIT 5 to end of query, it will throw
Caused by: java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly ended
so this is the error query
@Query(value = "SELECT A, B ... FROM ADMIN.SUPER_SEARCH WHERE A = :param OR B = :param ORDER BY A desc LIMIT 5", nativeQuery = true )
WHY?
I would really need the limit here, since table is about 300k rows long..
Upvotes: 0
Views: 66
Reputation: 3003
Try:
@Query(value = "SELECT A, B ... FROM ADMIN.SUPER_SEARCH WHERE A = :param OR B = :param AND rownum <= 5 ORDER BY A desc", nativeQuery = true )
Upvotes: 2