Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Complex Query

Complex Query

From: <medavarm_at_usa.redcross.org>
Date: 2000/05/17
Message-ID: <8fv4dk$669$1@nnrp1.deja.com>#1/1

Hi,

I got this query:

select d.id, d.site, d.spon, d.total_presenting, r.dtype, rr.codabarwbn wbnstart,rx.codabarwbn wbnend
from drive d, regis r, uniquewbn rr, uniquewbn rx where trunc(d.ddate)='26-APR-00'
and d.id = r.drv
and r.id = rr.donatkey
and (rr.codabarwbn, rx.codabarwbn) in
(select min(uniquewbn.codabarwbn), max(uniquewbn.codabarwbn) from regis,uniquewbn
where d.id = regis.drv and regis.id = uniquewbn.donatkey) order by d.id

and I get these results:

        ID SITE SPON TOTAL_PRESENTING D WBNSTAR WBNEND

---------- ---------- ---------- ---------------- - ------- -------
     14968       1051        852               35   F 89770 F 89801
     14968       1051        852               35   F 89770 F 89801

Why am I getting duplicate rows?
I know there is a join missing but how do I do that. Can somebody modify this query to avoid the duplicate rows.

Thank you,
Moorthy

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Wed May 17 2000 - 00:00:00 CDT

Original text of this message

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