>To find the start of all the gaps:
>Select k.numfield+1 as manko From yourtable k;
> Where k.numfield+1 Not in (Select numfield From yourtable)
>
>
>>A table has an index column that starts at one and goes to N, with some missing values. Is there an SQL Select statement (its ok to use more than one) that will return the first x items that are NOT present in the column?
>>
>>TIA,
>>
>>Alex
That will suit my purpose, Tore, thank you. I will only be only looking for the first gap which I will use as the next id (in case somehow the value on the "next index" table has gone over the top). Hope it runs fast.
Alex