At 9:30 +0100 12/20/02, Thierry Michalowski wrote:
Hello,
I'm trying to run the following SQL statement on a table of my MySQL DB:
insert into MYTABLE(ID, VALUE, SORTKEY)
select T.ID, 'to to', MAX(T.SORTKEY) + 1 from MYTABLE as T group by
T.ID
You can't insert into the same table that you're selecting from.
This is in the manual.
You could select into a temp table, then select that into your
original table.
---------------------------------------------------------------------
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