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 DISTINCT a.id+1 FROM tbl a LEFT OUTER JOIN tbl b ON b.id = a.id+1 WHERE b.id IS NULL;
Stuck with a problem? Got Error? Ask ChatGPT!
Copy Clear