SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
with tbl as ( SELECT level as id from dual CONNECT BY level <= 5 union all SELECT 7 as id from dual union all SELECT 10 as id from dual ) --6, 8, 9 SELECT id, id+1 as start_interval, next_id-1 as finish_interval FROM( SELECT id, LEAD(id) OVER (ORDER BY Id) as next_id FROM tbl )T --WHERE id+1 <> next_id
Stuck with a problem? Got Error? Ask ChatGPT!
Copy Clear