MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Josh L Bernardini Date:January 15 2003 12:37am
Subject:three table join
View as plain text  
I want a list of all the people in all the meetings in a given event, for
the purpose of printing all their schedules.

I can get a list of meetings in an event given the event id with the
following query:

select meetings.id from meetings where eid=2;



People are assigned meetings in the table mpeople which contains a person
id and a meeting id, I can get a list of people in a meeting given a
meeting id:

select firstname, lastname from people left join mpeople on people.id =
mpeople.id where mpeople.mid=1;



?How do I get the list of all the people in all the meetings given an event
id? Naturally the following doesn't work in 3.23.54.

select firstname, lastname from people left join mpeople on people.id =
mpeople.id where mpeople.mid IN (select meetings.id from meetings where
eid=2);

couldn't follow the join three tables comment in the documentation.
thanks in advance,
jb




Thread
three table joinJosh L Bernardini15 Jan
  • Re: three table joinMichael T. Babcock15 Jan
  • Re: three table joinBrent Baisley15 Jan
RE: three table joinTab Alleman15 Jan
  • Re: three table joinHarald Fuchs16 Jan
  • Re: three table joinMichael T. Babcock22 Jan
RE: three table joinDiana Soares15 Jan