Date: Thu, 16 Aug 2007 14:45:45 -0700
Reply-To: Dave <dave.lewandowski@THOMSON.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Dave <dave.lewandowski@THOMSON.COM>
Subject: Re: Different results when group by expression v group by variable
Content-Type: text/plain; charset="us-ascii"
On Aug 16, 4:20 pm, Reeza <fkhurs...@hotmail.com> wrote:
> I'm missing something, one says group by state one says group by
> county which is what you're getting?
> Reeza- Hide quoted text -
> - Show quoted text -
Sorry. I should have explained the FIPS codes used by the US Census.
In a 5 digit FIPS code, the first two digits are the state code and
the third through fifth digits are the county codes. County codes are
reused for each state so only the combination uniquely identifies a
county and are often referred to as cnty_fips or sometimes scfips.
Both queries should return state populations totals. In this made up
example, 39213 for state 16 and 242172 for state 17.
I realize using DISTINCT on the first query will fix the problem. But
my experience with Oracle is that it would never return duplicate rows
to a group by query. As sometimes happens to me using SAS, there's
some larger issue related to SAS processing that I don't understand.
Is that happening again in this case?