Not sure the best way to ask this question, but here goes...
I have a Database table that has a column called pos_id that is an auto increment field, and I have used it as a tracking device for the next position number in a company forced matrix system...
Now I need to convert the table to be used in a different manner that will not be tracking position IDs on an incremental basis but rather on a semi random basis, where there may be holes in the numbering system.
Position IDs start at 10,000,000 and currently go up to 10,039,765.
pos_id will no longer be an auto increment field, but will be a generated number based on various criteria at times, and at other times I need to find the Smallest unused pos_id available, if that option is selected by the member...
Baiscally Here is my question...
How would I format the query to find the smallest value of pos_id that doesn't exist yet as a record number??
I hope this makes sense... Here are the fields in the table, but I don't really need to gather information from the table, just need to determine the smallest available pos_id.
Column Type
pos_id int(9)
mem_id int(8)
prev_pos_id int(9)
create_date datetime
last_update datetime
status char(1)
If more clarification is required, please let me know what you need...
Thank you in advance for your feedback.
Douglas