LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 2008, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 12 Feb 2008 09:42:11 -0800
Reply-To:   Reeza <fkhurshed@HOTMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Reeza <fkhurshed@HOTMAIL.COM>
Organization:   http://groups.google.com
Subject:   SQL logic help
Comments:   To: sas-l@uga.edu
Content-Type:   text/plain; charset=ISO-8859-1

Hi All,

I know this isn't quite the right group, but I also know there's a lot of SQL programmers here.

I have a simple set of logic that I can't quite get to work.

I have a list of activities, the activity date, the group and the activity ID.

What I need to do is select by group, the last activity, the date and corresponding activitity ID for a specific activity.

In SAS my code would be something like this

proc sort data=have; by group activity_date;

data need; set have; where activity=2; by group; if first.group; keep group activity_date activity_ID; run;

I just need some help translating this to SQL, please :)

TIA, Reeza


Back to: Top of message | Previous page | Main SAS-L page