| SQL - Questions and Answers Have a SQL question? Post it here. First do a search to see if someone hasn't already answered it. |
|
|||
crosstab query in sqlHi,
I'm trying to write a query to reorganize data from veritcal to horizontal.. I can do this in access using a crosstab query but hoping to find a way to do it in sql so I can join the results with another table in the database. the data I'm trying to crosstab looks like below... ID Title Data 1 A x 1 B 1 1 C 1/1/2008 2 A z 2 D 2 3 E B 4 E B 5 B 2 I want the resulting table to look like this: ID A B C D E 1 x 1 1/1/2008 2 z 2 3 B 4 B 5 2 There being one ID for each row, Title values being the column headings and Data values being the data. the values in Title and Data can be anything (both stored as text) and there are no fixed number of Titles, but for each ID they are unique. Please let me know if this is something that is possible and if so how to get started. Thanks in advance! |
|
Be the first to answer this question! Click on the 'Post Reply' button below.
|
![]() |
| Thread Tools | Search this Thread |
|
|