I'm trying to select the first occurrence of record on two conditions but have been in vain. Here's my codes:
PROC SQL;
CREATE TABLE table1 AS
SELECT user_id, type, date, money
FROM table2
WHERE date IN (SELECT MIN(date)
FROM twice_transaction
GROUP BY user_id,type);
For example the original table looks like this(table2)
user type date money
user1 type1 1/10/2012 money1
user1 type1 2/20/2012 money2
user1 type2 1/15/2012 money3
user1 type2 2/30/2012 money4
user2 type1 3/28/2012 money5
user2 type2 2/14/2012 money6
user2 type2 4/13/2012 money7
but I want only: (table1)
user1 type1 1/10/2012 money1
user1 type2 1/15/2012 money3
user2 type1 3/28/2012 money5
user2 type2 2/14/2012 money6
How should I modify/code for my end result? thanks!