[thelist] SQL for what I think might be many to many

Andrew Forsberg andrew at thepander.co.nz
Fri Apr 19 17:13:01 CDT 2002


On Sat, 2002-04-20 at 09:58, John Corry wrote:

> SELECT [fields I want] FROM beaches_table, condo_table,
> walking_distance_table WHERE beaches_table.beach_id =
> walking_distance_table.beach_id
>
> wouldn't that return everything I need to display:
> the beach info
> which condos are walking distance away
> the condo info for those condos
> ?

I agree, except you'll also need:

AND condo_table.condo_id = walking_distance_table.condo_id

so the right condo info is grabbed as well.

Cheers
Andrew





More information about the thelist mailing list