Monday, October 28, 2013

SQL query

Try



with cte as
(Select person,action,[date],flag,ROW_NUMBER() OVER(PARTITION BY person,action ORDER BY [date]) rn from tab1
select person,action,[date],flag
from cte
where rn=1;





Many Thanks & Best Regards, Hua Min


No comments:

Post a Comment