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 |
What are the basic techniques of indexing?
What is keys and its types?
What is the difference between distinct and unique in sql?
Explain autonomous transaction.
what is 'mysqld'? : Sql dba
How does join work in sql?
What does plv msg allows you to do?
Why triggers are used?
What do you know by pl/sql cursors?
select * from emp where sal in(select max(sal) from emp) here there is any limit for in operator how many values accpect ?
What is a record in a database?
what is sql in mysql? : Sql dba