Click here to Skip to main content
Rate this: bad
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,
Posted 29-Nov-12 21:06pm

1 solution

Rate this: bad
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.[^]
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 Zoltán Zörgő 335
1 Peter Leow 155
2 BillWoodruff 120
3 CHill60 110
4 CPallini 80
0 Sergey Alexandrovich Kryukov 9,423
1 OriginalGriff 6,891
2 Peter Leow 4,692
3 Zoltán Zörgő 4,344
4 CHill60 2,932

Advertise | Privacy | Mobile
Web03 | 2.8.150129.1 | Last Updated 30 Nov 2012
Copyright © CodeProject, 1999-2015
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