Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
sanj
Starting Member
22 Posts |
Posted - 2012-11-08 : 12:36:28
|
Hi,I am trying to convert a horizontal recordset to vertical, I've seen some other post an know I need a pivot table but have got confused:the recordset output looks like:my query is:SELECT tbl_reviews.ReviewerID, tbl_reviews.ReviewerStatus, tbl_reviews.ReviewerComments, tbl_Files.Type, tbl_Files.FileName, tbl_Login_1.CompanyName, tbl_Login_1.ContactName, tbl_Files.FileIDFROM tbl_Login AS tbl_Login_1 RIGHT OUTER JOIN tbl_reviews ON tbl_Login_1.LoginID = tbl_reviews.ReviewerID LEFT OUTER JOIN tbl_Login INNER JOIN tbl_Files ON tbl_Login.LoginID = tbl_Files.LoginID ON tbl_reviews.FileID = tbl_Files.FileIDWHERE (tbl_Files.FileID = 37)The Current Output is13 A NULL Docs Doc1.pdf ABC username1 379 NULL NULL Docs Doc1.pdf DEF username2 37I am looking at returning the recordset as:37 Docs Doc1.pdf 13 A Null ABC username1 9 Null Null DEF username2 Any help is appreciated. |
|
|
|
|