database,sql,query,table


Hi,

have been told to use joins and after reading the manual a bit I do not 
know what it is about. I have added couple of examples. Could anyone tell 
me what difference is in them if any? the MY: is what I have been using and 
SUGGESTED is what was offered to be instead of MY:

MY: select * from baseinfo,addressinfo where baseinfo.aid=addressinfo.aid;

SUGGESTED: select * from baseinfo LEFT JOIN addressinfo ON 
baseinfo.aid=addressinfo.aid;

SUGGESTED: select * from baseinfo LEFT JOIN addressinfo USING (aid);

MY: Select * from baseinfo,addressinfo,postalinfo Where 
baseinfo.aid=addressinfo.aid and 
addressinfo.postalnumber=postalinfo.postalnumber;

SUGGESTED: select * from baseinfo LEFT JOIN addressinfo ON 
baseinfo.aid=addressinfo.aid LEFT JOIN postalinfo ON 
addressinfo.postalnumber=postalinfo.postalnumber;


What kind of practical uses do you have for JOINS?

Jari Mäkelä 


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to