It's often good practice with multiple tables to reference them when
you refer to the fields also, eg table1.field1, table2.field3, e.t.c.;
 I'm not sure whether the brackets are needed, or indeed in the right
place however the rest looks okay.  With MySQL it may be useful to
note that...

SELECT field1, field2, field3, field4
FROM table1
        LEFT INNER JOIN table2 ON table2.idf = table1.idf
        LEFT INNER JOIN table3 ON table3.idf = table2.idf
        LEFT INNER JOIN table4 ON table4.idf = table2.idf;

Is the same as

SELECT field1, field2, field3, field4
FROM table1, table2, table3, table4
WHERE table2.idf = table1.idf
        AND table3.idf = table2.idf
        AND table4.idf = table2.idf;


Phill

On 21/07/06, Prinze Adam <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
>  Is this the right way to join 4 tables?
>
>  SELECT f1, f2, f3, f4
>  FROM (
>  (
>  FIRST LEFT JOIN SECOND ON idf1= idf2
>  )
>  LEFT JOIN third ON idf2= idf3
>  )
>  LEFT JOIN fourth ON idf2 = idf4
>  LIMIT 30
>
>


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Yahoo! Groups gets a make over. See the new email design.
http://us.click.yahoo.com/XISQkA/lOaOAA/yQLSAA/HKFolB/TM
--------------------------------------------------------------------~-> 

Community email addresses:
  Post message: php-list@yahoogroups.com
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to