MySQL Forums
Forum List  »  General

Re: JOIN table USING vd JOIN table ON table_field=another_table_field
Posted by: Arjen Lentz
Date: February 28, 2009 04:00PM

Peter Brawley Wrote:
> When the joining columns have the same name, they're synonyms.

Well, functionally they can be, but that depends on how you use them.
USING indeed depends on having the same column names in both tables.
But ON can take any expression, so (... AND ...) is possible and sometimes necessary for certain join constructs, and that of course can't be done by USING.

> USING ... is not portable, so best avoided.

USING is standard SQL, I just verified that in the SQL-99 spec.

Regards, Arjen.
--
Arjen Lentz, Exec.Director @ Open Query (http://openquery.com)
Remote expertise & maintenance for MySQL/MariaDB server environments.

Follow us at http://openquery.com/blog/ & http://twitter.com/openquery

Options: ReplyQuote


Subject
Written By
Posted
Re: JOIN table USING vd JOIN table ON table_field=another_table_field
February 28, 2009 04:00PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.