GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  Mainframe  >  DB2
Go To First  |  Previous Question  |  Next Question 
 DB2  |  Question 13 of 195    Print  
What is the difference between group by and order by?
Group by controls the presentation of the rows, order by controls the presentation of the columns for the results of the SELECT statement.


  
Total Answers and Comments: 3 Last Update: December 09, 2006   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
October 30, 2006 03:59:57   #1  
sul        

RE: What is the difference between group by and order ...
u can use aggregate functions (sum, avg etc) with group by
 
Is this answer useful? Yes | No
November 09, 2006 06:52:51   #2  
anilp        

RE: What is the difference between group by and order ...

The GROUP BY keyword is used when we are selecting multiple columns from a table (or tables) and at least one arithmetic operator appears in the SELECT statement.

eg1: SELECT NAME FROM TABLE1 GROUP BY ROLLNO

Can use Agregate functions with GROUP BY

EG2:SELECT NAME FROM TABLE1 ORDER BY ROLLNO ASC


 
Is this answer useful? Yes | No
December 09, 2006 18:53:41   #3  
Blue Gazoo        

RE: What is the difference between group by and order ...

Group By forms Groups (of course), but this means it also SORTS; but it will also retrieve a DISTINCT RECORD SET

ORDER BY Sorts by the columns included in the Statement, and does not retrieve DISTINCT Records.

Neither determines the order of the columns (the order of the SELECT Statement does).


 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape