Find Distinct results in spring data jpa
Im trying to fetch Distinct records, SQL query looks as follows
select DISTINCT id from Table A where UserId = 'XXXX';
Currently, I have implemented this using spring data jpa @Query
@Query(value = "select DISTINCT id from Table A where UserId = :userId")
Can this be achived through spring data jpa query method ?