Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

spring jpa group by query method

@Query("SELECT c.year, COUNT(c.year) FROM Comment AS c GROUP BY c.year ORDER BY c.year DESC")
	List<Object[]> countTotalCommentsByYear();
Source by www.baeldung.com #
 
PREVIOUS NEXT
Tagged: #spring #jpa #group #query #method
ADD COMMENT
Topic
Name
7+5 =