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

Is ms sql is free?

0 Answers  


Why is sql*loader direct path so fast?

0 Answers  


what are all the different types of indexes? : Sql dba

0 Answers  


What is latest version of sql?

0 Answers  


What does over partition by mean in sql?

0 Answers  






what is 'mysqlshow'? : Sql dba

0 Answers  


Why do we use view in sql?

0 Answers  


what is view? : Sql dba

0 Answers  


Explain table and field in sql?

0 Answers  


What is prepared statement in sql?

0 Answers  


What is difference between nchar and nvarchar?

0 Answers  


how to rename an existing table in mysql? : Sql dba

0 Answers  


Categories