I have a table of payments with these columns:
PaymentDate,UID,Item,Amount,Status,TransactionID
I'd like to retrieve the first instance of each purchase by a user (UID) where Status is "Completed".
For example
1/1/2003,10,Socks,7,Pending,1001
1/1/2003,10,Socks,7,Completed,1002
1/2/2003,11,Shirt,20,Pending,1003
1/2/2003,11,Shirt,20,Completed,1004
1/3/2003,11,Pants,30,Completed,1005
should return:
1/1/2003,10,Socks,7,Completed,1002
1/2/2003,11,Shirt,20,Completed,1004