Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to 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 29-Nov-12 20:06pm
Dee_Bee3.5K

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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[^]
  Permalink  
Comments
Dee_Bee at 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 at 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)

  Print Answers RSS
0 OriginalGriff 6,649
1 Sergey Alexandrovich Kryukov 6,270
2 CPallini 5,190
3 George Jonsson 3,574
4 Gihan Liyanage 2,522


Advertise | Privacy | Mobile
Web01 | 2.8.140916.1 | Last Updated 30 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100