aspose file tools*
The moose likes JDBC and the fly likes 'Order by'  vs 'Group by' Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark " Watch " New topic
Author

'Order by' vs 'Group by'

Rao Raghu
Ranch Hand

Joined: Jan 05, 2007
Posts: 100
Whats the difference between 'Order by' and 'Group by'in SQL? Where do we use each?


RAGHU<br /> <br />"When the going gets tough, the tough get going"
Arman Galustyan
Greenhorn

Joined: Mar 07, 2007
Posts: 10
Gooooooogle


Software development is risky.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29275
    
140

Order by is for sorting.

Group by is for providing groups/sets of columns that you can provide some function on like count(*)


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
wood burning stoves
 
subject: 'Order by' vs 'Group by'
 
Similar Threads
Java Beginners D Group
Query and sub query question in Oracle SQL.
How to group the threads together ?
SCJP - Study group
Game on SQL