Date: Fri, 16 May 2008 12:45:17 -0400
Reply-To: "Howard Schreier <hs AT dc-sug DOT org>"
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Howard Schreier <hs AT dc-sug DOT org>"
Subject: Re: SQL confusion
Content-Type: text/plain; charset=ISO-8859-1
On Fri, 16 May 2008 11:09:17 -0400, Mark Smolkin <marksmolkin@GMAIL.COM> wrote:
>Hi..I am fairly new to SQL and am confused by a sentence in the SAS 9.1
>SQL Procedure User's Guide. The text below is from pg. 41 and I don't
>quite understand the second criteria mentioning the "where" clause. To
>examine it, I created fake data and I saw that I could use a summary
>function like "sum(cost)" as the lone item in the select clause, use a
>where clause that subsetted on an a separate variable, and still receive
>the correct overall sum without an error message. I am sure I am simply
>misinterpreting the sentence and so I was hoping somebody could set me
>straight....Appreciate the help!...
>"In the previous example, PROC SQL combined information from multiple rows
>of data into a single row of output. Specifically, the world oil reserves
>for each country were combined to form a total for all countries.
>Combining, or rolling up, of rows occurs when
> the SELECT clause contains only columns that are specified within an
> the WHERE clause, if there is one, contains only columns that are
>specified in the SELECT clause."
Same example appears in
I agree that the second condition is wrong, and I have no idea as to what
point it was intended to make.