Grouping a class using stream java 8 or in SQL whichever is best
问题 The data is something like this head child assigned total [ Mas Mas1 2 5 , Mas Mas2 0 5 , Usr usr1 4 4 , Usr usr2 1 3 , Inv Inv1 3 5 , Inv Inv2 2 3 , Inv Inv3 2 3 , Inv Inv4 1 3 ] I want sum of their child for a particular header. I am using partition in sql select head, SUM(childAssigned) over (partition by am.acl_group) as assignedHead, sum(childTotal) over (partition by am.acl_group) as totalHead, child, childAssigned, childTotal Since, "partition by" is not supported by HQL