Find value not in between values.

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi all.

 I have a SQL question I am having trouble with. We have a table, with
a column that contains a code. These codes start at '00001', '00002',
'00003', '00004'... and so on. If the record containing '00003' as it's
code is deleted from the table, is there an SQL statement that can be
used to find the first missing record. I guess what we are looking for
is the lowest value of CODE not in the list of values between two
values, such as in the case '00001' to '99999'.

Thanks in Advance
Ron VanDerMaarel
VDM Management Systems Inc.

Re: Find value not in between values.

may need to create additional table that has 10000 number pre-loaded in good
sequence which can be use in join query to select where matching record is

Quoted text here. Click to load it

Site Timeline