hey there!
i have 3 tables.
[ol]
[li]event - list of events[/li]
[li]participant - list of participants[/li]
[li]participant_to_event - linking participants to a given event[/li]
[/ol]
let's say i have three participants with the ids 100, 200 & 300.
i would like to get the event id from participant_to_event where these 3 participants have participated.
is it possible to do in one query?
something like:
which of course doesn't work
also, i don't know how many participants are actually participating in each event...
any ideas?
(-:
i have 3 tables.
[ol]
[li]event - list of events[/li]
[li]participant - list of participants[/li]
[li]participant_to_event - linking participants to a given event[/li]
[/ol]
let's say i have three participants with the ids 100, 200 & 300.
i would like to get the event id from participant_to_event where these 3 participants have participated.
is it possible to do in one query?
something like:
Code:
SELECT * FROM `event` AS ev STRAIGHT_JOIN `participant_to_event` AS pa
WHERE ev.`event_id`=pa.`event_id` AND (pa.`participant_id`=100 AND pa.`participant_id`=200 AND pa.`participant_id`=300)
also, i don't know how many participants are actually participating in each event...
any ideas?
(-: