Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Why functions are used in sql?

1044


How do I write a cron which will run a sql query and mail the results to agroup?

1034


How do you know if a relationship is 2nf?

994


What is sql*plus?

1122


what are the authentication modes in sql server? : Sql dba

1121


how do you tune the slow running queries in oracle db , explain the methodology

3235


What is the difference between clustered and non-clustered index in sql?

1067


What are the parts of a basic sql query?

1017


What does pl sql developer do?

982


How to use boolean type in select statement?

1139


Explain the purpose of %type and %rowtype data types with the example?

1047


What's the difference between a primary key and a clustered index?

1028


What is forward declaration in pl sql?

1141


how to calculate the difference between two dates? : Sql dba

1115


what is the syntax for using sql_variant_property? : Transact sql

1086