Date: Fri, 16 Feb 1996 07:04:56 GMT
Reply-To: Robert Bachler <danac@INTELE.NET>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: Robert Bachler <danac@INTELE.NET>
Organization: CBC Consulting Group
Subject: Re: An SQL question
Carol Bristow <CEB%NCCIBM1.BITNET@VTBIT.CC.VT.EDU> wrote:
>Since this seems to be the week for SQL questions, I've got one that
>I've looked at on and off for a while now.
>I have a database that has "parent" records with multiple "children",
>with each parent-child relationship being one-to-many. I generally
>have to produce reports with the children in adjacent columns. For
>example:
><deleted text>
>Is there a way to get around the problem of data being duplicated
>when joining the records using SQL? When I have tried using SQL, I
>get duplicate data, which can play havoc when you have to summarize
>the columns at a later step in the report!
If you are getting exact duplicates, use
SELECT DISTINCT <fields>.....
This works like the PROC SORT NODUPS option.