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

What is meant by cursor in sql?

723


how would you get the current date in mysql? : Sql dba

720


What is function and procedure?

752


How do you bind variables in pl sql?

753


Mention what does plv msg allows you to do?

850






What is the difference between python and sql?

701


What can you do with pl sql?

764


What does count (*) mean in sql?

1291


What is the difference between mdf and ndf files?

775


What is trigger in sql and its types?

752


How to run sql functions in pl/sql?

721


What is the best free sql database?

760


Does truncate table reset auto increment?

716


What is the difference between pl and sql?

730


What is int identity in sql?

753