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 sql and how does it work?
How to write html code in pl sql?
What is data profiling in sql?
Can we perform dml on view?
What are different clauses used in sql?
What is sql prepared statement?
how to get @@error and @@rowcount at the same time? : Sql dba
What action do you have to perform before retrieving data from the next result set of a stored procedure ?
How can we link a sql database to an existing android app?
What is difference sql and mysql?
How to run sql statements through the web interface?
What are the types of views in sql?
What's the difference between inner join and left join?
how to create a table index in mysql? : Sql dba
What is trigger in sql and its types?