Comma separated JOIN syntax

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When using JOINS by the simply supplying a comma separated list of tables in 
the FROM clause, is the ON argument normally associated with a join intended 
to be addressed in the WHERE clause, or should ON still be used?

// Comma separated join
SELECT u.*, a.city FROM users u, addresses a WHERE u.id=a.user_id;

// Actual JOIN clause
SELECT u.*, a.city FROM users u INNER JOIN addresses a ON u.id=a.user_id;


// Query style in question
SELECT u.*, a.city FROM users u, addresses a ON u.id=a.user_id;

If not ON, is there at least another viable argument?  The reason I'm 
interested is for a query involving 5 or 6 tables and WHERE arguments which 
do not deal with the relationships.  I would like to assure the efficiency 
of this query.


Thanks in advance,
Matt 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux