SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
with tbl as ( SELECT 1 as id from dual union all SELECT 2 as id from dual union all SELECT 3 as id from dual union all SELECT 4 as id from dual union all SELECT 5 as id from dual union all SELECT 7 as id from dual union all SELECT 10 as id from dual ) SELECT t1.id +1 FROM ( SELECT id, LEAD(id, 1) OVER (ORDER BY ID) AS next_id FROM tbl ) t1 WHERE t1.next_id is null;
Stuck with a problem? Got Error? Ask ChatGPT!
Copy Clear