Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


What is the difference between group by and order by?

Answers were Sorted based on User's Feedback



What is the difference between group by and order by?..

Answer / sunil1405

Group By controls the presentation of rows , order by
controls the presentation of columns.

Is This Answer Correct ?    15 Yes 7 No

What is the difference between group by and order by?..

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

Post New Answer

More DB2 Interview Questions

What are column-name qualifiers used?

1 Answers  


Is schema the same as database?

0 Answers  


How could one combine a set of incremental image copies into a single copy?

1 Answers  


What does the RUNSTATS Utility do?

4 Answers  


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!

17 Answers   KNIT, Tech Mahindra,






What is table space in db2?

0 Answers  


Can we declare DB2 HOST variable in COBOL COPY book?

2 Answers  


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?

1 Answers  


What is a DB2 bind?

3 Answers  


What is CHECK PENDING ?

5 Answers  


Can i insert bulk records into a db2 table using qmf of spufi only............!!!

2 Answers  


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?

1 Answers  






Categories