On 4/15/2016 6:04 AM, Paul Sanderson wrote:
> but I would like a table of the rows that bracket the missing rows e.g.
>
> 3, 5
> 5, 8
> 11, 14

with Brackets as (
   select t1.id low, (select min(t2.id) from mytable t2 where t2.id > 
t1.id) high
   from mytable t1
)
select low, high from Brackets where high > low + 1;

-- 
Igor Tandetnik

Reply via email to