Hi,
I have column named "sequence" . I have data in this column like 1,2,3,4,5,7,9,10,15 .
I need to find out missing sequence numbers from table .
what is the sql query to find missing sequence numbers from table ? I am expecting results like 6,8,11,12,13,14
Thanks a lot
EDIT
I just need to return one column like
Missing numbers
6
8
11
12
13
14
I am using only one table
I tried this query but am not getting the expected result.Here is the query
select de.sequence + 1 as sequence from dataentry as de
left outer join dataentry as de1 on de.sequence + 1 = de1.sequence
where de1.sequence is null order by sequence asc;