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: GROUP BY question

Re: GROUP BY question

From: William LEE <william_at_alumni.cuhk.edu.hk>
Date: 1997/10/15
Message-ID: <620a91$mg8@hpg30a.csc.cuhk.edu.hk>#1/1

If you have an index on the email column, the following SQL will be very efficient.

select a.email, a.name, a.id
from table a
where exists (
  select null
  from table b
  where b.email = a.email
  and b.id != a.id);

--

William WW LEE.
E-Mail: william_at_alumni.cuhk.edu.hk
***********************************
Received on Wed Oct 15 1997 - 00:00:00 CDT

Original text of this message

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