Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> subquery returning no rows in WHERE clause

subquery returning no rows in WHERE clause

From: Thomas Briggs <tom_at_sane.com>
Date: Thu, 03 Jun 1999 10:18:26 -0400
Message-ID: <37568EB2.45BF477E@sane.com>


Is there any way in Oracle8 to have a not-equals comparison against a subquery return rows when the subquery returns no rows?

Take the following query:

SELECT TextCol FROM Table1
WHERE IDCol <> (SELECT ID FROM IDTable
WHERE IDValue = '...')

When there is no matching record in the IDTable this returns no rows, as the subquery returns no
rows. Logically, however, this is incorrect - everything is not equal to nothing! Is there any
way (without an embedded PL/SQL function) to have this return the logically correct rows?

   Thanks
   -Tom Received on Thu Jun 03 1999 - 09:18:26 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US