February 11, 2011 at 2:44 pm
I need to pivot multiple columns. I am better off doing 2 different Pivots and joining them, or using case statements?
Are there other, better alternatives that I am not aware of?
February 11, 2011 at 4:16 pm
Look for the word multi-aggregate in the following artcle...
http://www.sqlservercentral.com/articles/T-SQL/63681/
--Jeff Moden
Change is inevitable... Change for the better is not.
February 11, 2011 at 5:25 pm
Thank you Jeff. Any Idea which one would perform better?
February 11, 2011 at 5:34 pm
You should test them side by side to be sure, but in my experience the cross-tab runs just a hair faster on average.
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
February 11, 2011 at 10:55 pm
Khades (2/11/2011)
Thank you Jeff. Any Idea which one would perform better?
I posted that near the end of the article. 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
February 14, 2011 at 10:59 am
Originally I had just read the multi-aggregate section. But after you said performance was at the end, I decided to read the whole thing and I learned quite a bit :). Thank you.
Excuse my noobiness with the forums, but how do I get to your other articles (Dynamic Cross-Tabs, EAV/NVP Conversions, pre-aggregation, etc)?
February 14, 2011 at 11:28 am
Khades (2/14/2011)
Originally I had just read the multi-aggregate section. But after you said performance was at the end, I decided to read the whole thing and I learned quite a bit :). Thank you.Excuse my noobiness with the forums, but how do I get to your other articles (Dynamic Cross-Tabs, EAV/NVP Conversions, pre-aggregation, etc)?
Just go back to that article and then click on my name at the top of the article.
--Jeff Moden
Change is inevitable... Change for the better is not.
February 14, 2011 at 2:55 pm
Thanks!
February 14, 2011 at 3:50 pm
You bet. Thank you for the interest and the feedback.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply