MySQL Forums
Forum List  »  Newbie

Auto reset of autoincremented id column after deleteion
Posted by: Ramakrishna Prasad Mangalaparthi
Date: August 19, 2010 06:17AM

Hi,

I have created a table with one column name is id and it is autoincremented everytime u insert data into the table.
_________________________________
| id | data |
----------------------------------------------------------

Whenever u insert data in the table, id value will be incremented. So suppose we have 20 entries in the table and the value of id in the last coumn will be 20.

Now i deleted first five rows in the table i.e, entries with id values from 1-5. Now the table starts from entry with id value = 6.

My problem is I want the id values to be started from 1 for the remaining entries. when i delete the entries with id values 1-5, the row with id value = 6 should be reset to 1.

Can u just tell me whether it is possible first of all? If yes, can u tell me how?

Options: ReplyQuote


Subject
Written By
Posted
Auto reset of autoincremented id column after deleteion
August 19, 2010 06:17AM


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.