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 -> odd sub-select problem

odd sub-select problem

From: Daniel Schmolze <usenet_at_schmolze.com>
Date: 29 Oct 2001 10:11:57 -0800
Message-ID: <12bb17fa.0110291011.32821eff@posting.google.com>


I'm trying to do something which I think is very simple. I have a table, A, which contains about 13000 rows, and a table B which contains about 1600 rows.

Both these tables have a NAME column in the same domain. I want to display the NAMEs in A which are not in B. To do this, I'm using the following query:

SELECT NAME FROM A
WHERE NAME NOT IN (SELECT NAME FROM A) This returns no rows. If, however, I do the following:

SELECT NAME FROM A
WHERE NAME IN (SELECT NAME FROM A) (In other words, show me all the names in A that *are* in B)

I get about 1500 rows, as expected. Can anyone shed some light on this?

Thanks. Received on Mon Oct 29 2001 - 12:11:57 CST

Original text of this message

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