Forum Moderators: open
You could setup a routine to read through the table and find the missings, based on an increment of 1.
Or you could setup a control table with values 1,2,3,4,5,6,7,8,etc. and do a comparison between the two to see what doesn't match.
I'd love to see some other ideas for this one.
If you can do it if you setup a table with just a list of integers in it. If you have a table called 'numbers' with one column, 'i', then the following query would work:
select min(i) from numbers where i not in (select id from test);
This would return the lowest missing 'id' from the table 'test', assuming that 'numbers' went that high. Not sure if there is a way to do it without the table, someone else may know.
Chad