Re: MySQL 4 to MySQL 5 - SQL syntax question.
One thing I keep running into upgrading from MySQL4 to MySQL5 is a difference in LEFT JOIN... for example
SELECT users.name, department.name as department, countries.name as country FROM users, departments LEFT JOIN countries on users.country = countries.uid
[I'm faking this as I type - ignore any typos)
The above WILL work in MySQL4 but not in MySQL5! I'm not sure why it is different but to get it working in MySQL5 the above query needs to be:
SELECT users.name, department.name as department, countries.name as country FROM (users, departments) LEFT JOIN countries on users.country = countries.uid
I simply added parenthesis around the table names. All fixed.
Subject
Views
Written By
Posted
11305
September 08, 2006 07:46AM
4694
September 08, 2006 09:52AM
6760
September 11, 2006 02:00AM
Re: MySQL 4 to MySQL 5 - SQL syntax question.
5337
April 22, 2008 07:38AM
4066
April 22, 2008 08:17AM
4004
February 19, 2008 01:43AM
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.