Click here to Skip to main content
15,892,965 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
group by functionality in single table in sql server 2008.

Thanks in advance.
Posted
Updated 7-Nov-13 22:25pm
v2
Comments
Tejas Vaishnav 8-Nov-13 4:26am    
what is your question? have you tried anything or trying searching over internet for any solution.

try this query -

SELECT <column1>,<column2>,<column3>FROM <table_name>
GROUP BY <column1>,<column2>,<column3>
SQL
SELECT column1,column2,SUM(column3)
FROM Table_Name
GROUP BY column1,column2


SQL
SELECT column1,column2,SUM(column3)
FROM Table_Name
WHERE column1='' AND column4=''
GROUP BY column1,column2


and so on

Regards
Rakshit
 
Share this answer
 
Comments
tioncet 12-May-14 16:03pm    
Well done Rakshit, it's something we all had to go through, but it's hard to find a simple example.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900