如何使用Spring Data JPA进行非重复计数?我不想使用@Query注释。等效的sql查询为:
@Query
SELECT COUNT(DISTINCT rack) FROM store WHERE id = 10001;
我通过编写以下查询进行了尝试,但无法正常工作:
int countDistinctRackById();
spring spring-data-jpa spring-boot spring-repositories
spring ×1
spring-boot ×1
spring-data-jpa ×1
spring-repositories ×1