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