Here is the data that i have
Product_ID Question Answer
1 When Monday
1 Where Home
1 Where Work
1 How Car
2 When saturday
2 Where Home
2 Where Church
2 How Bus
2 How Walk
I would like the data to presented as below
Product_ID When Where How
1 Monday Home Car
1 Monday Work Car
2 Saturday Home Bus
2 Saturday Church Bus
2 Saturday Home Walk
2 Saturday Church Walk
But I was only able to pivot the data and was able to get in the below style
Product_ID When Where
1 Monday Work
2 Saturday Home
using the below query
select * from
(
select product_ID,question,answer from table1
) src
pivot (
max(answer)
for question in ([when],[where])
)piv