Click to See Complete Forum and Search --> : SQL Query with join help needed


jnmunsey
04-13-2006, 02:47 AM
I have one table with fields:
performerid
performername
eventid

another table with fields:
eventid
eventname

I want to make a query that lists all eventnames for a given performerid

Any help is appreciated

jnmunsey
04-13-2006, 02:55 AM
Never mind I figured it out on the first try...

SELECT Events.* FROM EventPerformers LEFT JOIN Events ON EventPerformers.EventID=Events.EventID WHERE EventPerformers.EventID = Events.EventID AND EventPerformers.PerformerID = 61

61 is a performerid

if there is a better way please let me know.

oh and this is for mysql

Terrorke
04-13-2006, 03:39 AM
This one is just fine ;)

jnmunsey
04-13-2006, 03:48 AM
Thanks, Chief!