Rows to columns by joining to tables
I have two tables
FIRST TABLE
CompID,Name
-----------
1 ,A
2 ,B
SECOND TABLE
CompID,Value
-------------
1 ,P
1 ,Q
2 ,R
2 ,S
2 ,T
I want a SQL query to get the resultset like the following
CompID,Value1,Value2,Value3
1 ,P ,Q ,null
2 ,R ,S ,T
Any help will be highly appreciated
Subhasis Chandra
|