Possible Duplicate:
Fragmentation of id's (auto_increment column) in mysql
I have this column in my database. Let's say its name is 'threadid'. It contains unique ids given to each thread for distinction.
threadid 9 8 7 6 5 4 3 2 1
Let's say I have deleted threads with id 5 and 6.
threadid 9 8 7 4 3 2 1
But when there is a submission after the deletion, the unique id given to that thread is 10. not 5. I think this is not neat.
How do I get the least possible value in the column? (in this case, 5.)
I think I can get the minimum value of the column using MIN() and keep +1 until I get the unused, unique value, but I think that's too complicated.
Is there any simple way to do this?
Thanks.