Sql Query

  • YearTeraExperiantScreenAssessment

    2007400300200100

    20084000300020001000

    200940000300002000010000

    201040000300002000010000

    This sample table I need SQL Query which prints below

    2010200920082007Year

    10000100001000100Assessment

    20000200002000200Screen

    30000300003000300Experiant

    40000400004000400Tera

  • 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.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • 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

    http://www.sql-programmers.com/

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply