The AskTOM team is taking a break over the holiday season, so we're not taking questions or responding to comments. Please have a happy and safe festive season and as always, thanks for being a member of the AskTOM community.
Thanks for the question, Naveen.
Asked: November 23, 2015 - 3:49 pm UTC
Last updated: November 25, 2015 - 11:38 pm UTC
Version: 10
Viewed 1000+ times
create table t ( order_no int ); insert into t values (20001200); insert into t values (20001201); insert into t values (20001202); insert into t values (20001203); insert into t values (20001204); insert into t values (20001205); insert into t values (20001206); insert into t values (20001209); insert into t values (20001210); insert into t values (20001212); insert into t values (20001214); insert into t values (20001218); with rws as ( select 20001200 + rownum - 1 r from dual connect by level <= (select max(order_no)-min(order_no) from t) ) select r from rws where not exists (select * from t where rws.r = t.order_no) order by r; R ---------- 20001207 20001208 20001211 20001213 20001215 20001216 20001217
Naveen Bhogaraju, November 23, 2015 - 4:07 pm UTC
Naveen Bhogaraju, November 23, 2015 - 4:13 pm UTC
Jeff, November 25, 2015 - 9:30 pm UTC
Share and learn SQL and PL/SQL; free access to the latest version of Oracle Database!
Classes, workouts and quizzes on Oracle Database technologies. Expertise through exercise!