Date: Mon, 26 May 2008 07:31:20 -0700
Reply-To: Yuewei <yueweiliu@VIP.QQ.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Yuewei <yueweiliu@VIP.QQ.COM>
Organization: http://groups.google.com
Subject: Re: A simple question about sql.
Content-Type: text/plain; charset=GB2312
On 5月26日, 下午10时22分, Uelsasser <UlrichElsas...@t-online.de> wrote:
> Hi
>
> try
>
> data have have1;
> input value;
> cards;
> 15.9
> 13.35
> 12.87
> 12.87
> 10.22
> 5.01
> ;
> run;
>
> proc sql;
> select a.value, (select count(value) as ncount from have where value
> < a.value)
> from have as a
> ;
>
> Output :
>
> value
> -----------------------------------
> 15.9 5
> 13.35 4
> 12.87 2
> 12.87 2
> 10.22 1
> 5.01 0
That IS cool !
Thanks very much!
|