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
What does partition by mean in sql?
What are expressions?
how to add a new column to an existing table in mysql? : Sql dba
What is %rowtype in pl sql?
How to sort the rows in sql.
What is insert command in sql?
How do I send sql query results to excel?
What is bulk collect in pl sql?
What is a database event trigger?
How can get second highest salary in sql?
Is ms sql is free?
What is execution plan in sql?
What is meant by cursor in sql?
What does select top 1 do in sql?
What is row_number () in sql?