Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

How to take sum of column with same id in "JPQL?"

public interface CodeRepository extends JpaRepository<Code, Integer> {
    @Query("select c.code, c.name, count(l) as amount from Code c join c.counterList l group by c.code, c.name")
    List<Object[]> getSummary();
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #How #sum #column #id
ADD COMMENT
Topic
Name
5+5 =