Home » SQL & PL/SQL » SQL & PL/SQL » Regarding IN Operator
Regarding IN Operator [message #318554] Wed, 07 May 2008 03:08 Go to next message
saharookiedba
Messages: 56
Registered: September 2007
Location: PUNE
Member
Hi,

I have written a Query as below

SELECT lic.ID, licdet.ID
FROM license lic, license_details licdet
WHERE lic.ID = licdet.LicenseID
AND licdet.ID IN (SELECT Predecessor FROM license_details
                  WHERE Predecessor IS NOT NULL)


Now suppose the subquery returns three records

100
101
102


Will the above query fetch records for all three records(100, 101, 102) returned by the subquery or as soon as it gets a match for the first record i.e 100 it won't check for 101, 102..

Do i need to use ANY instead of IN in the Query..
please let me know..
Re: Regarding IN Operator [message #318563 is a reply to message #318554] Wed, 07 May 2008 03:17 Go to previous message
rleishman
Messages: 3724
Registered: October 2005
Location: Melbourne, Australia
Senior Member
Looks like you're just learning SQL. There are some nice tutorials available in the 11g documentation http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28843/toc.htm

For questions like this, you can answer them yourself by trying it out. That way you're certain to remember it, whereas you will forget something that we tell you.

It will pick up ALL matching records, but please read the guidelines before your next post.

Ross Leishman
Previous Topic: Handle # character
Next Topic: Reg. cursor based delete! Little Urgent!
Goto Forum:
  


Current Time: Wed Dec 07 07:05:28 CST 2016

Total time taken to generate the page: 0.07294 seconds