Hi! Could we please enable some services and cookies to improve your experience and our website?

SQLize | PHPize | SQLtest

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

A A A
Login    Share code      Blog   FAQ
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 AI support!

Copy Clear