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 subquery? : Sql dba

0 Answers  


What does the base_object_type column shows in the user.triggers data dictionary view?

0 Answers  


What normalization means?

0 Answers  


Can we update views in sql?

0 Answers  


Main diff between varray and nested tablea

3 Answers   Polaris, TCS,






write an sql query to get third maximum salary of an employee from a table named employee_table. : Sql dba

0 Answers  


What are the advantages of the packages

6 Answers   Oracle,


How do I find duplicates in the same column?

0 Answers  


what are the differences between public, private, protected, static, transient, final and volatile? : Sql dba

0 Answers  


What can I use instead of union in sql?

0 Answers  


Does oracle use sql?

0 Answers  


how to retrieve the top 2 salaried persons from a database?

7 Answers   Orion Laboratories,


Categories