List:General Discussion« Previous MessageNext Message »
From:Dotan Cohen Date:September 9 2011 8:09pm
Subject:Update on inner join - looks good to me, where did I go wrong?
View as plain text  
I'm trying to update on an join, but I can't find my error:

UPDATE `userTable`
SET `someField`="Jimmy Page"
FROM `userTable` INNER JOIN `anotherTable`
  ON `userTable.userid`=`anotherTable.userid`
WHERE `userTable.someField`="Jim Morrison"
  AND `anotherTable.date` < NOW();

ERROR 1064 (42000): You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near 'FROM

That error is for reserved words, and I am escaping all the fields and
tables (using the backticks). So why the error?

This is on a CentOS 4 or 5 server, with MySQL 5.0.77, accessed from
the CLI. Thanks!


-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com
Thread
Update on inner join - looks good to me, where did I go wrong?Dotan Cohen9 Sep
  • Re: Update on inner join - looks good to me, where did I go wrong?Dotan Cohen9 Sep
    • Re: Update on inner join - looks good to me, where did I go wrong?Carsten Pedersen10 Sep
      • Re: Update on inner join - looks good to me, where did I go wrong?Dotan Cohen10 Sep