mysql : possible to put IF statment in LEFT JOIN ?
- by Haroldo
Ok so i want to get an artists info from the db, but i want to know if they have any forthcoming events. To do this i need to traverse 2 tables, where events_artists is a 2 col link table...
(this doesnt work but is what id like to do)
SELECT art.*, events.event_id FROM art
LEFT JOIN events_artists
ON art.art_id = events_artists.art_id
LEFT JOIN events
ON events_artists.event_id = events.event_id IF ( {criteria} )
what should i be doing here to get this to work?!!