If there are 1 to 100 numbers in a table and in that 100
numbers some 10 numbers are deleted.I want to find out the
missing numbers between 1 to 100 by pl/sql how?

Answer Posted / vishnu

create table test100 (id number);

insert into test100
select level from dual connect by level <=100;

select id from (SELECT rownum id from test100) where id
not in (select ID from(select rownum,id from test100) where id!=decode(id,rownum,rownum+1,rownum));

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you join views in sql?

538


What is a unique key and primary key and foreign key?

565


Can we rollback after truncate?

561


How can we store rows in PL/SQL using array?

662


what is timestamp in mysql? : Sql dba

561






how to dump a table to a file with 'mysqldump'? : Sql dba

545


What is a trigger in sql?

634


How can I tell if sql is running?

584


What are % type and % rowtype?

570


Can triggers stop a dml statement from executing on a table?

614


What is pl sql architecture?

498


Why do we use procedures?

510


What is sql server and ase?

538


What is indexing in sql and its types?

539


What is sql entity?

528