SQL rows into columns
Posted: Tue Dec 11, 2007 5:01 am
Is it possible to search a table and pull the results into columns.
I have 5 distinct rows. And i would like to be able to move these disctint rows in colums and go down through the table and fill in the columns with the distinct rows and leave if the distinct row for that search blank if null.
ie
into this
I have 5 distinct rows. And i would like to be able to move these disctint rows in colums and go down through the table and fill in the columns with the distinct rows and leave if the distinct row for that search blank if null.
ie
Code: Select all
USERID | COURSEID | SCORMID | ELEMENT | VALUE
---------------------------------------------------
1 1 1 status incomplete
1 1 1 time 0:0:12:23
1 1 1 exit suspendCode: Select all
USERID | COURSEID | SCORMID | STATUS | TIME | EXIT
--------------------------------------------------------------------------------------------------
1 1 1 incomplete 0:0:12:23 suspend