List:General Discussion« Previous MessageNext Message »
From:Carsten Pedersen Date:September 9 2011 10:48pm
Subject:Re: Update on inner join - looks good to me, where did I go wrong?
View as plain text  
`userTable.userid` => `userTable`.`userid`

/ Carsten

On 09-09-2011 23:01, Dotan Cohen wrote:
> 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!
>
>
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