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: classic header detail report, don't want duplicate detail records.

Re: classic header detail report, don't want duplicate detail records.

From: Ruud de Koter <nobody_at_internet.org>
Date: Fri, 16 Sep 2005 15:48:11 +0200
Message-ID: <432acd15$0$11067$e4fe514c@news.xs4all.nl>


T wrote:

> select distinct * from table
> 
> 
> <jason_at_cyberpine.com> wrote in message 
> news:1126806379.729065.221470_at_g44g2000cwa.googlegroups.com...
> 

>>two tables, one to many relationship. Second table can have duplicate
>>records.
>>
>>Want a classic report
>>
>>master
>> detail
>> detail
>> detail
>>
>>But don't want duplicate detail records.
>>
>>Here's the very simple code without addressing duplicates.
>>
>>SELECT JCPMASTER.KEY1, JCPDETAIL.DATA2
>>FROM JCPDETAIL, JCPMASTER
>>WHERE (JCPMASTER.KEY1 = JCPDETAIL.REPEATS)
>>
>>KEY1 AND REPEATS ARE MY REF KEYS.
>>
>>Many Thanks.
>>

>
Thouhg I hate to have my second contribution in the negative: there are considerable drawbacks to using the distinct keyword, as was discussed in a recent thread. You may want to try and find that thread for the other suggestions brought up (mainly using 'group by' if memory serves me right). The only bomb-proof solution obviously is to do away with the duplicates.

Ruud de Koter Received on Fri Sep 16 2005 - 08:48:11 CDT

Original text of this message

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