Home » SQL & PL/SQL » SQL & PL/SQL » ORDER BY & GROUP BY Clauses
ORDER BY & GROUP BY Clauses [message #425272] Thu, 08 October 2009 06:39 Go to next message
tunde009
Messages: 3
Registered: October 2009
Junior Member
Hello all,
When the ORDER BY and GROUP BY Clauses appears together in a query,which of the two `clauses takes precedence?
I mean which comes first? Thanks
Re: ORDER BY & GROUP BY Clauses [message #425289 is a reply to message #425272] Thu, 08 October 2009 07:11 Go to previous messageGo to next message
Michel Cadot
Messages: 63806
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
First GROUP BY then ORDER BY.
ORDER BY is ALWAYS the last executed step.

Regards
Michel
Re: ORDER BY & GROUP BY Clauses [message #425332 is a reply to message #425272] Thu, 08 October 2009 11:35 Go to previous message
Kevin Meade
Messages: 2098
Registered: December 1999
Location: Connecticut USA
Senior Member
tunde009, why did you need to know this. Do you require a more indepth understanding of the possibilities?

Michel's answer is the pat answer but as always there is a deeper truth that can be discussed if necessary.

Kevin
Previous Topic: need in oracle
Next Topic: Error inserting values in ORDBMS table
Goto Forum:
  


Current Time: Wed Sep 28 00:39:56 CDT 2016

Total time taken to generate the page: 0.18056 seconds