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
What is relationship? How many types of relationship are there?
What is use of term?
How we can update the view?
what is the difference between ereg_replace() and eregi_replace()? : Sql dba
Difference between truncate, delete and drop commands?
what is the difference between a web-garden and a web-farm? : Sql dba
What is dml and ddl?
Is inner join same as self join?
why does the selected column have to be in the group by clause or part of an aggregate function? : Sql dba
What is difference between my sql and sql?
how to extract a unit value from a date and time? : Sql dba
What are the types of functions in sql?
Do triggers have restrictions on the usage of large datatypes, such as long and long raw?
Explain constraints in sql?
what is cursor. write example of it. What are the attributes of cursor.