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 is rename in sql?
How bulk collect improves performance?
what is 'mysqlimport'? : Sql dba
What is cursor in pl sql?
Can we create a trigger on view?
How much ram can sql express use?
Write the command to remove all players named sachin from the players table.
What is the difference between the conventional and direct path loads? : aql loader
1) Synonyms 2) Co-related Subquery 3) Different Jobs in Plsql 4) Explain Plan 5) Wrap 6) Query Optimization Technique 7) Bulk Collect 8) Types of index 9) IF primary key is created then the index created ? 10) Foreign Key 11) Exception Handling 12) Difference Between Delete and Trunc 13) Procedure Overloading 14) Grant Revoke 15) Procedure Argument types. 16) Functions. 17) Joins
How to raise user-defined exception with custom sqlerrm ?
can sql servers linked to other servers like oracle? : Sql dba
Explain the methods used to protect source code of pl/sql.
what is self join and what is the requirement of self join? : Sql dba
How is use pl and sql?
What are the steps for performance tuning.