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 -> Re: SELECT

Re: SELECT

From: marc parkinson <marcpark_at_starband.net>
Date: Sat, 19 Oct 2002 00:13:15 GMT
Message-ID: <Rs1s9.135$FC2.66262175@twister2.starband.net>


This will not work because the username != * in the second select. This is also a terible query from a performance query. I would suggest something like the following

Select *
 from users
 where username in (
  select username
  from users
  minus
 select username
  from blacklist);

Marc G. Parkinson

"johnn" <john62_at_electronmail.com> wrote in message news:3DB09AD5.5FB6370_at_electronmail.com...
> 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/
> ----------------------------------------------------------------
Received on Fri Oct 18 2002 - 19:13:15 CDT

Original text of this message

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