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

Explain basic SQL queries with SELECT from where Order By,
Group By-Having?

Answer Posted / swapna

Order by clause is used to sort information of a table into
specific order either ascending or descending order.

syntax:select stmt order by column;

ex:select * from emp order by sal;

Group by clause is used to divide entire group into
subgroups based on the common values columns.we can use
group by clause along with group functions.

syntax:select group by(exp 1),group by(exp 2),....from
table name group by column name;
select max(sal),min(sal) from emp group by deptno;
Group by clause can allow where clause.


Having:is used to restrict information of the atble based
on condition.

syntax:select group by (exp 1) ,group by (exp 2) from table
name group by column having (condition).

Having and Group by clauses can interchange their positions.

but when using having along with order by clause having
should be placed before order by clause.

Is This Answer Correct ?    25 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you list all the columns in a database?

900


How do I save a stored procedure in sql server?

950


What is collation sensitivity?

1007


Explain acid?

1034


Explain triggers in sql?

908


What is a linked server in sql server?

1029


What is the order in which the sql query is executed?

899


What is the purpose of indexing?

1013


What is difference between table aliases and column aliases? Do they affect performance?

926


What is tablesample?

1053


What do you think of this implementation? Can this be implemented better?

891


Explain the difference between control flow and data flow?

949


Explain the disadvantages of cursors?

1076


Can you explain full-text query in sql server?

982


Once setting replication, can you have distributor on sql server 2005, publisher of sql server 2008?

917