Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: odd sub-select problem
On 29 Oct 2001 10:11:57 -0800, Daniel Schmolze
<usenet_at_schmolze.com> a écrit:
>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)
There must be a typo :-)
You should try "minus", it could be more efficient. As for your question, are you names unique ?
-- DamienReceived on Mon Oct 29 2001 - 12:14:35 CST