Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Complex Query
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
![]() |
![]() |