July 15, 2010 at 10:49 am
YearTeraExperiantScreenAssessment
2007400300200100
20084000300020001000
200940000300002000010000
201040000300002000010000
This sample table I need SQL Query which prints below
2010200920082007Year
10000100001000100Assessment
20000200002000200Screen
30000300003000300Experiant
40000400004000400Tera
July 15, 2010 at 4:01 pm
You might want to start with the UNPIVOT statement (see BOL aka BooksOnLine, the SQL Server help sytem for details).
As a next step you should have a look at the CrossTab or DynamicCrossTab article referenced in my signature.
July 19, 2010 at 11:46 pm
I have a blog article to maybe assist you with your question:
http://www.sql-programmers.com/Blog/tabid/153/EntryId/6/Using-PIVOT-and-UNPIVOT.aspx
SQL Server Programmers and Consultants
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply