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
i would like to illustrate what i understood
suppose i want to select students whose id > 2000 and age
my query would be like this
select * from students where id >2000 and age >30 order by
age desc ;
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|
What are column-name qualifiers used?
Is schema the same as database?
How could one combine a set of incremental image copies into a single copy?
What does the RUNSTATS Utility do?
I have a table which has thousand of records i want to fetch only record num 100 to record num 200. Write a query that satisfies this criteria.(Cant use any keys) Anyone please reply ASAP!
What is table space in db2?
Can we declare DB2 HOST variable in COBOL COPY book?
Why do we need to create an alias if we can directly use the table name? What are the benefits of referring a table name by its alias? Also, when should we go for alias and when for synonyms?
What is a DB2 bind?
What is CHECK PENDING ?
Can i insert bulk records into a db2 table using qmf of spufi only............!!!
COBOL PRECOMPILER ERROR: "XXXXXX" (TABLE) PREVIOUSLY DECLARED OR REFERENCED DCLGEN VARIABLES GETS IMPORTED TWICE FOR ONLY ONE EXEC SQL STATEMENT. WHAT COULD BE THE PROBLEM?