1
我有以下查詢:我可以把它變成一個數據透視表嗎?
select q.description question,
group_concat(a.description) answers
from answer a
join question q on a.question_id = q.id
where survey_id = 6
group by q.id
它給了我一個結果,看起來是這樣的:
question answers
Do you like cats? Yes,Yes,No,Yes
Do you like pizza? Yes,Yes,Yes,No
有什麼辦法,我可以得到更多的東西一樣嗎?
question answer1 answer2 answer3 answer4
Do you like cats? Yes Yes No Yes
Do you like pizza? Yes Yes Yes No
可能沒有。是否有固定數量的答案? – 2010-12-03 19:25:14