Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SELECT
johnn wrote:
> Okay. Let's say I have a list of usernames in the table users. Let's
> say I have a list of bad users in the table blacklist. Now, let's say I
> want to select all the usernames from the table users that are not in
> the table blacklist? How do I do this? I was thinking of stuff like
> the following:
>
> select * from users where username not in (select * from blacklist);
>
> but it doesn't work.
>
> --
> ----------------------------------------------------------------
> This message was sent from an Electronmail.com email address.
> Electronmail.com offers 6MB of free e-mail, free news, and more.
> http://www.electronmail.com/
> ----------------------------------------------------------------
There are at least six different ways to write this query. But all require identifying a specific field or fields or the comparison. You can not use SELECT *. Likely the quickest will be one using NOT EXIST with the MINUS in the middle and NOT IN among the slower possibilities.
Daniel Morgan Received on Sun Oct 20 2002 - 10:59:02 CDT
![]() |
![]() |