is it necessary to write group by and order by clause together
Answers were Sorted based on User's Feedback
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 |
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 |
Is ms sql is free?
Why is sql*loader direct path so fast?
what are all the different types of indexes? : Sql dba
What is latest version of sql?
What does over partition by mean in sql?
what is 'mysqlshow'? : Sql dba
Why do we use view in sql?
what is view? : Sql dba
Explain table and field in sql?
What is prepared statement in sql?
What is difference between nchar and nvarchar?
how to rename an existing table in mysql? : Sql dba