Try
with cte as(Select person,action,[date],flag,ROW_NUMBER() OVER(PARTITION BY person,action ORDER BY [date]) rn from tab1select person,action,[date],flagfrom ctewhere rn=1;
Many Thanks & Best Regards, Hua Min
No comments:
Post a Comment