I have following Table:
+------+--------------+------------+--------+
| ID | TestID | QuestionId | Answer |
+------+--------------+------------+--------+
| 1 | 10 | 15 | 0 |
| 2 | 10 | 23 | 0 |
| 3 | 10 | 41 | 1 |
| 4 | 16 | 15 | 0 |
| 5 | 16 | 23 | 1 |
| 6 | 16 | 41 | 1 |
| 7 | 24 | 15 | 1 |
| 8 | 24 | 23 | 0 |
| 9 | 24 | 41 | 0 |
+------+--------------+------------+--------+
For internal reports I need following output:
+--------------+----------------+----------------+----------------+
| QuestionId | Test_1 | Test_2 | Test_3 |
+--------------+----------------+----------------+----------------+
| 15 | 0 | 0 | 1 |
| 23 | 0 | 1 | 0 |
| 41 | 1 | 1 | 0 |
+--------------+----------------+----------------+----------------+
I have no idea how to do this. Do you have any suggestions?