I have a database like this:
id User_id Question_id Answer
1 john Question_1 b
2 john Question_2 a
3 john Question_3 d
4 harry Question_1 a
5 harry Question_2 a
6 harry Question_3 c
7 colleen Question_1 c
8 colleen Question_2 a
9 colleen Question_3 b
I want to display the content of the above data in the following format-
id User_id Question_1 Question_2 Question_3
1 john b a d
2 harry a a c
4 colleen c a b
How can I achieve this using sql? I am using mysql and php.