MySQL IDs question
#6

Quote:
Originally Posted by iTorran
Посмотреть сообщение
For each new row inserted into MySQL table, "ID" goes up by 1.
So e.g. if i add 5 rows.

ID: 1
ID: 2
ID: 3
ID: 4
ID: 5

But when i remove one.. e.g.

ID: 5

and add a new row, the ID of the new row is

ID: 6

So it goes:

ID: 1
ID: 2
ID: 3
ID: 4
ID: 6

Is there anyway to make it goto 5?
(if you know waht i mean)
No you can't do that afaik. However if you have a PRIMARY KEY then you can fix the key ID by using ANALYSE TABLE table_name;
Reply


Messages In This Thread
MySQL IDs question - by iTorran - 15.12.2011, 17:47
Re: MySQL IDs question - by Ricop522 - 15.12.2011, 17:49
Re: MySQL IDs question - by Sergei - 15.12.2011, 19:13
Re: MySQL IDs question - by DRIFT_HUNTER - 15.12.2011, 19:57
Re: MySQL IDs question - by Lorenc_ - 15.12.2011, 20:06
Re: MySQL IDs question - by XFlawless - 16.12.2011, 01:50

Forum Jump:


Users browsing this thread: 3 Guest(s)