SQLServer 2008 Pivot

Posted by Mitch on Stack Overflow See other posts from Stack Overflow or by Mitch
Published on 2010-04-16T00:05:47Z Indexed on 2010/04/16 0:53 UTC
Read the original article Hit count: 366

Filed under:
|
|
|

I need to show some information in a graph, the data is held in a SQL Server 2008 table. The graph is expecting 2 columns, one for QuestionNumber and the other for Score.

The table containing the data has column names that correspond to the question numbers ie A1, A2, A3, A4, B1, B2, B3, B4, C1, C2. Each question is given a score of 1 to 5. I need to show a graph where the X axis shows A1, A2, A3 etc and the Y axis shows the score.

I'm thinking I somehow need to rotate the data to achive this, but I'm not sure how. Maybe a different technique can acheive this rather that a Rotate, so I'm open to any ideas.

© Stack Overflow or respective owner

Related posts about sql

Related posts about server