On Sunday 09 September 2001 20:17, Armando Cerna wrote:
> Hi I am trying to update a table that is full of customer ID's using
> another table with the following command
>
> update customers set row_id=mc.id where tele=mc.tele;
>
> But it give me the error
>
> ERROR 1109: Unknown table 'mc' in where clause
>
>
> The table mc does exist I am pretty lost on this one any help would be
> great
With UPDATEs (and DELETEs) only the table being changed can be referenced in
the WHERE-clause.
A rather unobvious limitation if you come across it for the first time and
maybe one which could be pointed out more prominently on the relevant manual
pages:
http://www.mysql.com/doc/U/P/UPDATE.html
http://www.mysql.com/doc/D/E/DELETE.html
(although I see that mulitple-table delete will be supported from 4.0)
HTH
Ian Barwick
--
Ian Barwick - Developer - [EMAIL PROTECTED]
akademie.de asp GmbH - http://www.akademie.de
"To query tables in a MySQL database is more fun than eating spam"
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php