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 / neha sinha
create or replace procedure pro1(cur_diff OUT SYS_REFCURSOR) is
BEGIN
OPEN cur_diff FOR
select diff
from (select /*+ no_merge */
rownum as diff
from (select 1 from dual group by cube(1, 1,
1, 1, 1)) a,
(select 1 from dual group by cube(1, 1,
1, 1, 1, 1)) b)
where diff >= (select min(lst) from list1)
and diff <= (select max(lst) from list1)
minus
select lst from list1;
end pro1;
-- where list1 is table name and lst is column in which
--some no is missing
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Why do we use triggers?
How do you truncate?
Why do we go for stored procedures?
How can we implement rollback or commit statement in a trigger?
What are triggers in sql?
Which query operators in sql is used for pattern matching?
Which tcp/ip port does sql server run?
How can we link a sql database to an existing android app?
What is oracle and pl sql?
Can you join a table to itself?
What is a constraint?
How can a function retun more than one value in oracle with proper example?
What is a nested table in word?
Does truncate free space?
What is the location of pre_defined_functions.