December 12, 2013 at 10:25 am
Why do we used aggregate function in pivot operator and cross tab queries . Any link to blog or video explanning my question can do.
Thanks.
December 12, 2013 at 10:34 am
Shadab Shah (12/12/2013)
Why do we used aggregate function in pivot operator and cross tab queries . Any link to blog or video explanning my question can do.Thanks.
No offense intended but have you tried google? Using the EXACT wording from your post...
https://www.google.com/#q=Why+do+we+used+aggregate+function+in+pivot+operator+and+cross+tab+queries
Look at the very first return.
Generally speaking pivot or crosstabs are used as summary data. The details are aggregated.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
December 12, 2013 at 10:34 am
2 great articles by Jeff Moden on the subject:
January 1, 2014 at 1:05 pm
Shadab Shah (12/12/2013)
Why do we used aggregate function in pivot operator and cross tab queries . Any link to blog or video explanning my question can do.Thanks.
The simple answer is "because" we want data from different rows to show up on the same row. One of the better ways to do that is to use aggregation even if there's only one value and the aggregation returns that same value.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply