GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Tech FAQs  >  PL/SQL
Go To First  |  Previous Question  |  Next Question 
 PL/SQL  |  Question 98 of 157    Print  
in my table "temp" one column contain 1 to 10 range of values in between some numbers are missing. like below

TEMP
column1
1
2
4
7
5

so in this table i want search missing number from 1 to 10.
so output should be
3
6
8
9.
how to get this o/p?

  
Total Answers and Comments: 3 Last Update: July 10, 2007     Asked by: santo 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
June 07, 2007 08:14:08   #1  
gaurav_gupta81        

RE: in my table "temp" one column contain 1 to 10 rang...
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

 
Is this answer useful? Yes | No
June 14, 2007 08:09:20   #2  
Amit        

RE: in my table "temp" one column contain 1 to 10 rang...

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)



 
Is this answer useful? Yes | No
July 10, 2007 10:05:16   #3  
chakraborty_sarkar Member Since: July 2007   Contribution: 2    

RE: in my table "temp" one column contain 1 to 10 rang...
SELECT LEV FROM (SELECT LEVEL LEV FROM dual CONNECT BY LEVEL < 10) WHERE LEV NOT IN (SELECT COLUMN1 FROM TEMP);
 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape