List:General Discussion« Previous MessageNext Message »
From:Josh Trutwin Date:October 3 2002 7:57pm
Subject:Re: Is there Examples and Documents on joining tables?
View as plain text  
> Is there a document that compiles examples on different ways of joining
> two or more tables?  I found a few on
> http://www.mysql.com/doc/en/JOIN.html but they do not cover joining more
>  than two tables.
>
> Thanks for any suggestions.

I wish there were more examples as well!

I use this for multi-table joins:

SELECT table1.bunch, table2.of, table3.stuff FROM table1
   INNER JOIN table2 ON table2.some_id
   INNER JOIN table3 ON table3.some_id
WHERE table1.some_id = table2.some_id AND table1.some_id = table3.some_id;

Not sure if this the best way or not, but it works...

Anyone with more experience care to contribute?  Are there optimum ways to
join multiple tables?

Josh


Thread
Is there Examples and Documents on joining tables?damovand3 Oct
  • gemini/acid or innodb ?David yahoo3 Oct
  • Re: Is there Examples and Documents on joining tables?Arthur Fuller3 Oct
  • Re: Is there Examples and Documents on joining tables?Josh Trutwin3 Oct
  • Re: Is there Examples and Documents on joining tables?damovand4 Oct
  • Re: Is there Examples and Documents on joining tables?John Ragan4 Oct
    • Re: Is there Examples and Documents on joining tables?damovand4 Oct
      • Re: Is there Examples and Documents on joining tables?John Ragan4 Oct
      • Re: Is there Examples and Documents on joining tables?John Ragan4 Oct
      • informationFlorian Litot16 Oct
    • Re: informationGustavo Vieira Gonçalves Coelho Rios17 Oct
  • Re: Is there Examples and Documents on joining tables?Arthur Fuller4 Oct
  • Re: Is there Examples and Documents on joining tables?Arthur Fuller4 Oct
Re: Is there Examples and Documents on joining tables?Josh Trutwin4 Oct