Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: odd sub-select problem
Hi,
if i understand you correctly is the following solution correct.
select distinct a.name from a,b where a.name = b.name;
Mfg Neimoa
"Daniel Schmolze" <usenet_at_schmolze.com> schrieb im Newsbeitrag
news:12bb17fa.0110291011.32821eff_at_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 Tue Oct 30 2001 - 02:35:02 CST