• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Group By in Java

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ranchers,

We use group by option in SQL. Do we have any API that we can use to mimic this functionality?

Sorting or Arrays or List can be done using or respectively.
In the same way do we have groupBy too?
Kind Regards,
Sham.
 
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The GroupBy Operator in SQL is described like this:
"The GROUP BY statement is used in conjunction with the aggregate functions to group the result-set by one or more columns"

This sounds exactly like Arrays.sort(...) or Collections.sort(...) using different Comparators which sort based on the column you want to 'Group By'.
 
reply
    Bookmark Topic Watch Topic
  • New Topic