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...

What is the difference between group by and order by?

Answer Posted / visakh viswanath

Difference between order by and group by having ?

suppose i have students table which has id number ,sname
varchar2(20),marks1number ,marks2 number,marks3 number,age
number.

i would like to illustrate what i understood
suppose i want to select students whose id > 2000 and age
>30

my query would be like this
select * from students where id >2000 and age >30 order by
age desc ;
or
else
select * from students group by age ,id having age >30 and
id >2000 ;

so both the queries would be same but in the first one i
use order by followed by my condition in where .
in second once i used group by which would group according
to the age or id and then having is same as where condition
in the above .

Is This Answer Correct ?    3 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

In an sql table that is embedded, what is the procedure to retrieve rows that are part of a db2 table?

1079


Mention the different locking levels that are available in db2.

1116


Is ibm db2 free?

994


What is null value in db2?

999


What are the different types of base tables?

1070


How do I start db2 in windows?

1073


What is dbrm? When it will be created?

1007


Explain packages.

1089


Is db2 a programming language?

1028


What is db2 look?

1007


What is data manager?

1026


What is table space in db2?

1002


Which component is responsible for processing sql statements and selecting access paths?

1111


Explain correlated sub-queries.

1010


by using cursors , we can access particular records from the table based on some condition, i want to delete those selected records, how can we write a query for this in the program?

9151