MySQL Forums
Forum List  »  Newbie

Re: How to retain "Key" order when Deleting a Row
Posted by: David Fells
Date: April 11, 2005 10:34PM

You'd have to do a second query manually, and there is really no point in doing this. It's a bad idea to rely on a machine generated sequence for operations in general.. but if you must...


DELETE FROM table WHERE id = 5;
UPDATE table SET id = id-1 WHERE id > 5;

Options: ReplyQuote


Subject
Written By
Posted
Re: How to retain "Key" order when Deleting a Row
April 11, 2005 10:34PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.