sunil88_pal88 (7/22/2015)
Many thanks Luis
You're welcome.
Do you understand how it works? Please post any questions that you have about this.
Here are some references:
Unpivot using CROSS APPLY: http://www.sqlservercentral.com/articles/CROSS+APPLY+VALUES+UNPIVOT/91234/
Cross tabs: http://www.sqlservercentral.com/articles/T-SQL/63681/