What is the difference between group by and order by?
Answers were Sorted based on User's Feedback
Answer / sunil1405
Group By controls the presentation of rows , order by
controls the presentation of columns.
| Is This Answer Correct ? | 15 Yes | 7 No |
Answer / visakh viswanath
Difference between order by and group by having ?
suppose i have students table which has id number ,sname
varchar2(20),marks1number ,marks2 number,marks3 number,age
number.
i would like to illustrate what i understood
suppose i want to select students whose id > 2000 and age
>30
my query would be like this
select * from students where id >2000 and age >30 order by
age desc ;
or
else
select * from students group by age ,id having age >30 and
id >2000 ;
so both the queries would be same but in the first one i
use order by followed by my condition in where .
in second once i used group by which would group according
to the age or id and then having is same as where condition
in the above .
| Is This Answer Correct ? | 3 Yes | 7 No |
When is the results table for the query in a DECLARE CURSOR statement created?
What is tablespace?
in db2, already 10 columns arie der, and i want to insert 11th column. what parameters u wil consider for insertion and how will u insert
My DB2 program first read the data from a file and then it look into a table with the data it got from the file.If we did not bind the program , should the file read before SQL execution be success??
How is a typical DB2 batch program executed ?
what is copy pending and check pending ?
What is buffrpool? Where we use it ?
can any one give the list of some important sql abend codes which r frequently asked in interviews?
DB2 is a A) data base/data communication system B) data base C) RDBMS D) Programming language
how to resolve -805. give clear explination for that
My SQL is not performing well. Describe how will you fine tune it?
What is dbrm? When it will be created?