List:General Discussion« Previous MessageNext Message »
From:Dotan Cohen Date:September 9 2011 9:01pm
Subject:Re: Update on inner join - looks good to me, where did I go wrong?
View as plain text  
Now that I've got the syntax right, MySQL is complaining that a field
does not exist, which most certainly does:

mysql> UPDATE
    ->  `userTable`
    -> INNER JOIN `anotherTable`
    ->   ON `userTable.userid`=`anotherTable.userid`
    -> SET `userTable.someField`="Jimmy Page"
    -> WHERE `userTable.someField`="Jim Morrison"
    ->   AND `anotherTable.date` < NOW();
ERROR 1054 (42S22): Unknown column 'userTable.someField' in 'field list'
mysql>
mysql> SELECT count(someField) FROM userTable;
+---------------+
| count(someField) |
+---------------+
|          5076 |
+---------------+
1 row in set (0.00 sec)

mysql>

What could be the issue here? 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