|
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
|