I\'m working with PostgreSQL query implementing in JPQL.
This is a sample native psql query which works fine,
SELECT * FROM students ORDER BY id DESC
Hello for fetching single row and using LIMIT in jpql we can tell the jpql if it's a native query.
( using - nativeQuery=true )
Below is the use
@Query("SELECT s FROM Students s ORDER BY s.id DESC LIMIT 1", nativeQuery=true) Students getLastStudentDetails();