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 / ravi kumar singh

DECLARE
RETVAL NUMBER:=0;/*A_CHK IS TABLE AND A IS COLOUMN HAVING NOS*/
I NUMBER:=0;
BEGIN
FOR I IN 1..100
LOOP
SELECT COUNT(*) INTO RETVAL FROM A_CHK WHERE A=I;
IF (RETVAL=0) THEN
DBMS_OUTPUT.PUT_LINE(I);
ELSE NULL;
END IF;
END LOOP;
END;

Is This Answer Correct ?    15 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How does join work in sql?

550


What is difference between mysql and postgresql?

511


Differentiate between syntax and runtime errors.

640


what is the difference between primary key and unique key? : Sql dba

522


What is meant by <> in sql?

503






How will you distinguish a global variable with a local variable in pl/sql?

620


What is an inconsistent dependency?

579


What is $$ in sql?

549


Why stored procedure is faster than query?

515


how to drop an existing index in mysql? : Sql dba

533


How do I view output in sql developer?

574


Explain the update statement in sql

558


What is difference between stored procedure and trigger?

529


What is pl sql code?

585


how to include comments in sql statements? : Sql dba

541