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 / mani
DECLARE
l_id NUMBER;/* Temp IS TABLE AND ID IS COLOUMN HAVING
Numbers*/
BEGIN
FOR I IN 1..100 LOOP
SELECT COUNT(*) INTO l_id FROM temp WHERE id=I;
IF (l_id = 0) THEN
DBMS_OUTPUT.PUT_LINE(I);
ELSE
NULL;
END IF;
END LOOP;
END;
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is difference between sql function and stored procedure?
Why do we need view in sql?
Explain spool.
Why coalesce is used in sql?
what is the stuff function and how does it differ from the replace function? : Sql dba
What is the difference between truncate and drop statements?
What are the built in functions of sql?
What does 0 mean in sql?
What is the difference between execution of triggers and stored procedures?
What are different functions in sql?
Can we insert in view in sql?
I need a function for a train ticket reservation please answer it thanks in advance
What is execute immediate?
Why we use sql profiler?
What is your daily office routine?