Question is as follows: For each event, list the prize money available for first, second and third prize on one line.
So I need to list the EVENT_ID from the PRIZE table. Then there will be three separate columns displaying the first, second, and third prize.
Expected data is listed below:
| event_id | First | Second | Third |
| 101 | 120 | 60 | 30 |
| 102 | 10 | 5 | 2 |
| 103 | 100 | 60 | 40 |
| 401 | 1000 | 500 | 250 |
The table PRIZE has the information as listed:
| Event_id | Place | Money |
| 101 | 1 | 120 |
| 101 | 2 | 60 |
| 101 | 3 | 30 |
| 102 | 1 | 10 |
| 102 | 2 | 5 |
| 102 | 3 | 2 |
| 103 | 1 | 100 |
| 103 | 2 | 60 |
| 103 | 3 | 40 |
| 401 | 1 | 1000 |
| 401 | 2 | 500 |
| 401 | 3 | 250 |
| 401 | 4 | 100 |
| 401 | 5 | 50 |
So far I have:
SELECT event_id, money AS First, money AS Second, money AS Third
FROM PRIZE
WHERE money IN
(SELECT money FROM PRIZE WHERE place=1 IN
(SELECT money FROM PRIZE WHERE place=2 IN
(SELECT money FROM PRIZE WHERE place=3
GROUP BY event_id)));
SQL just gives an 'OK' statement and doesn't show a table. Help please?