| Date: | Wed, 29 Aug 2007 12:38:46 -0700 |
| Reply-To: | Syb it <sas_datalover@YAHOO.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Syb it <sas_datalover@YAHOO.COM> |
| Subject: | Re: Sql question |
|
| In-Reply-To: | <200708291931.l7THIfda003711@mailgw.cc.uga.edu> |
| Content-Type: | text/plain; charset=iso-8859-1 |
I am looking for an sql equivalent of outputing just the last row of my data, as the data step does as follows:
data have;
input id product $ supply date mmddyy10. flg;
format date date9.;
datalines;
1 A 15 3/15/1990 0
1 A 30 4/26/1990 0
1 B 30 4/26/1990 0
1 B 30 5/27/1990 1
1 B 67 8/18/1990 0
2 A 30 3/19/1990 0
2 A 30 3/20/1990 0
2 A 30 4/21/1990 1
2 A 30 5/22/1990 0
10 A 47 12/9/1991 0
;;;
run; proc print data=have; run;
data try;
set have; by id;
if last.id then output;
run; proc print; run;
---------------------------------
Moody friends. Drama queens. Your life? Nope! - their life, your story.
Play Sims Stories at Yahoo! Games.
|