Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem after upgrade

Status
Not open for further replies.

sirugo

Programmer
Aug 1, 2000
162
SE
I have been running MySQL 3.23 for some years.
Now we upgraded to 5.0 and I'm experiencing som problems.

Earlier the following query was executed flawlessly:

SELECT col1, col2, table2.col3
FROM table1, table2
LEFT JOIN table3 ON table1.someid = table3.someotherid

but now this query triggers an error:

Unknown column 'table1.someid' in on-clause.

When I delete the "table2" it works fine (if I also delete table2.col3):

SELECT col1, col2, table2.col3
FROM table1
LEFT JOIN table3 ON table1.someid = table3.someotherid

How can I change the query to run without an error?
 
your problem lies here --

table2 LEFT JOIN table3
ON table1.someid = table3.someotherid

the reason this is an error is because it has always been an error, but earlier versions let you get away with it

change your queries, don't use the comma-list style, use only JOIN syntax throughout, and bob's your uncle
Code:
  FROM table1
INNER
  JOIN table2
    ON table2.[i]foo[/i] = table1.[i]bar[/i]
LEFT OUTER 
  JOIN table3 
    ON table3.someotherid = table1.someid

r937.com | rudy.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top