So I've got a table that looks like this: (called PRIZE)
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
And I am trying to answer this question: 'For each event, list the prize money available for first, second and third place on one line. Group by event_id.
For eg. one row of results would appear:
Event_id First Second Third
101 120 60 30
I've got this so far:
SELECT Event_id, Money AS 'First'
FROM PRIZE
WHERE Place = '1'
GROUP BY Event_id;
but am really having trouble adding in the SQL for the 'Second' and 'Third' parts of the question.
Can anyone help?
Thanks!!