is it necessary to write group by and order by clause together

Answers were Sorted based on User's Feedback



is it necessary to write group by and order by clause together..

Answer / guest

No it is not necessary.

Is This Answer Correct ?    36 Yes 2 No

is it necessary to write group by and order by clause together..

Answer / suman

No Required.

Group by is grouping the records

but Order by mention the data should be desc or asc order.

Is This Answer Correct ?    0 Yes 0 No

is it necessary to write group by and order by clause together..

Answer / madhav

yes,
select deptno,sum(sal) from emp group by deptno;
(it displays ascending order)
when we want to display the descending order,we need order
by clause and group clause.
select deptno,sum(sal) from emp group by deptno order by
deptno desc
(it displays the descending order)

Is This Answer Correct ?    9 Yes 10 No

Post New Answer

More SQL PLSQL Interview Questions

what is sql and plsql

6 Answers  


What is the maximum rows in csv?

0 Answers  


What is left join example?

0 Answers  


how to check server status with 'mysqladmin'? : Sql dba

0 Answers  


Explain 3 basic parts of a trigger.

0 Answers  






I want to know last five transactions or records from emp table, from now?

11 Answers   Wells Fargo,


Name the different types of indexes in sql and define them.

0 Answers  


What is a trigger ?

11 Answers   Accenture, BirlaSoft,


Hi am new to PLSQL & facing problems in writing code like in SP, Functions, so any one having some SP coding with in depth explanation please share with me my Email ID suvarnaatsuvarna@rediffmail.com Or taking tanning on this please do contact me

0 Answers  


What is the difference between SQL table and the PLSQL table?

3 Answers   Mastek,


write the Sql query for creating database backup?

7 Answers   TCS,


what is text? : Sql dba

0 Answers  


Categories