Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Select Statement producing duplicate rows?
The query below select on 2 tables a customer master table (CUMSTPF) and a services table(SRVRPF) I used the GROUP BY to eliminate duplicates but my counts are doubled whe a customer has records for both service codes in the "S.AOSVCD In ('A001','P001')" statement below. How can I get it to count the customer only once if that customer has records for both service codes?
Thanks in advance!
SELECT C.CUNROV, C.CUCNO, C.CUSTA
FROM NE_ICOMS.SRVRPF S, NE_ICOMS.CUMSTPF C WHERE C.CUCNO = S.AOCNBR AND C.CUNROV = S.AONROV AND C.CUSTA = 'A' AND S.AOSVCD In ('A001','P001')
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Fri Jun 16 2000 - 00:00:00 CDT
![]() |
![]() |