In my table "temp" one column contain 1 to 10 range of values in between some numbers are missing. like belowTEMPcolumn112475so in this table i want search missing number from 1 to 10.so output should be 3689.how to get this o/p?

Showing Answers 1 - 9 of 9 Answers

gaurav_gupta81

  • Jun 7th, 2007
 

Its simple, just use such query

print ( select from (Loop var 1 to (count (select * from temp1)) where var NOT IN (select * from temp1))))

means just print the number from the loop where that number is not in the result provide by the select statement for that column.

Hope you get my point

  Was this answer useful?  Yes

Amit

  • Jun 14th, 2007
 

If I have Emp Table and id column
1
2
4
5
7
SELECT 10-id FROM Emp WHERE id in (SELECT id FROM Emp WHERE id <> 5)


  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions