Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
1.What is the matter of using aggregate function in pivot?
2.Can anybody explain how the 'PIVOT' works in SQL server ?
I tried even on Google, but couldn't understand how to use it.
As I am new here, hope you understand.
Experts out there, Please.
Thank you,

DeeBee
Posted

1 solution

SUM is the most used aggregate function, you can also use AVG,MAX,MIN,COUNT.

http://social.msdn.microsoft.com/Forums/en/transactsql/thread/4d6d0acd-fdb9-4961-be34-bc6fa1869ce3[^]
 
Share this answer
 
Comments
Dee_Bee 30-Nov-12 2:14am    
Thank a bunch for that, but why to use an aggregate function there? why not just a column name ? as it makes no difference using an aggregate function?

Please help.

Thank you
Mehdi Gholam 30-Nov-12 2:26am    
You have to specify what you want done on the data sum,count etc. so you have to write "sum" on the column name.

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