what is group by clause? what will happen when we use group by clause within a query?

Posted by Rajendra.prasad under Sql Server on 5/24/2011 | Points: 10 | Views : 2481 | Status : [Member] | Replies : 4
Hi,
what is group by clause? what will happen when we use group by clause within a query?

Regards,
Rajendra




Responses

Posted by: Nithadeepak on: 5/24/2011 [Member] Bronze | Points: 25

Up
0
Down
Refer this...
http://www.w3schools.com/sql/sql_groupby.asp
http://msdn.microsoft.com/en-us/library/ms177673.aspx
Thanks,

Nitha Deepak

Rajendra.prasad, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Susanthampy on: 5/24/2011 [Member] [MVP] Bronze | Points: 25
Posted by: Lakn2 on: 5/24/2011 [Member] Starter | Points: 25

Up
0
Down
Groupby clause is used to filter infromation from collection of records.

the main difference between where clause and Groupby clause is in where clause displays data only statisfied information but in case of group by clause first it groups based on condition and it stores in a buffer and then filters and display data.

Thanks&Regards
LakshmiNarayana Nalluri.

Rajendra.prasad, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sriramnandha on: 5/21/2012 [Member] Starter | Points: 25

Up
0
Down
GROUP BY CLAUSE IS USED FOR AVG,MAX,MIN,COUNT,SUM

EXAMPLE

SELECT * FROM EMPLOYEE WHERE EMPID NOT IN(SELECT EMPID FROM EMPLOYEE GROUP BY EMPID HAVING COUNT(*)<1)

REGARDS


sriram

Rajendra.prasad, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response