Am Donnerstag, 9. Januar 2003 15:28 schrieb Csongor Fagyal:
> Hi,
>
> Sorry if this had been asked on this list previously.
>
> If you had an auto_increment field in a table (let's name it "id"),
> previously (in 3.23.x, 4.0.x) the following (legal) SQL statement
> resulted in a "duplicate key" error:
> UPDATE whatevertable SET id = id +1;
>
> Will this be fixed in 4.1.x? Can it be fixed? Is there a workaround?
>
> Regards,
> - Cs.

The following should already do what you want:
UPDATE whatevertable SET id = id + 1 ORDER BY id DESC;
-- 
Christian Kohlschütter
[EMAIL PROTECTED]

http://www.newsclub.de - Der Meta-Nachrichten-Dienst


---------------------------------------------------------------------
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

Reply via email to