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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is sql and its types?

626


Explain aggregate functions are available there in sql?

534


How does a self join work?

521


What are the types of join in sql?

520


What is the purpose of using pl/sql?

666






How can we solve sql error: ora-00904: invalid identifier?

699


What is a relationship and what are they?

582


What is set serveroutput on in pl sql?

568


Is primary key a clustered index?

537


What is type and rowtype in pl sql?

539


what are the differences between require and include, include_once and require_once? : Sql dba

533


What is the file extension for sql database?

519


What is data type in sql?

557


How many parts of a pl sql block are optional?

523


What is linq to sql?

554