I'm looking for a way to convert rows to columns in SQL server.
This is my two Tables:
"Decisions"
D_Id R_ID Level_ID L_Date Decision_S
1 ch3 1 5/5/2015 Approved
2 ch3 2 5/6/2015 Approved
3 ch3 3 5/9/2015 Refused
"Request"
R_Type ID Creation_Date
Appropriation Request ch3 5/3/2015
I want to get this result:
R_ID Creation_Date Level1_Date Level2_Date Level3_Date
ch3 5/3/2015 5/5/2015 5/6/2015 5/9/2015
How can I build the result?
N.B:
The problem is i have to select from two tables at the same time, Where 'R_Id' equals 'ID' so it displays the 'R_Type', 'Level1_Date', 'Level2_Date' and other 'column headers' which they don't exist in both Tables.