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

Explain isolation levels that sql server supports?

1044


How can you find out if the current user is a member of the specified microsoft® windows nt® group or microsoft sql server™ role?

1040


How to set database to be single_user in ms sql server?

1035


What are secondary xml indexes?

1028


Does sql server 2016 have ssms?

963


How do I view a script in sql server?

1047


What are the restrictions that views have to follow?

972


How to create indexed view?

1047


How to handle error or exception in sql?

986


How you can move data or databases between servers and databases in sql server?

1054


What are the rendering extensions of ssrs?

157


What is normalization? Explain its different types?

1097


How network traffic be reduced by using the stored procedure?

1118


Can an entity have two primary keys?

982


Explain nested stored procedure. Syntax and an example for create nested stored procedure?

935