hellotry thishellotry this;with myTable AS( select 1 as code, '1/1/2000' as [crea_date] , 5 as [quantity] union all select 1 , '1/1/2000', 6 union all select 2 , '1/2/2000' , 1 union all select 3 ,'1/3/2000', 2 union all select 4 , '1/2/2000' , 4 union all select 4 ,'1/2/2000', 3)SELECT * FROM(SELECT * ,ROW_NUMBER() OVER(PARTITION BY code,[crea_date] ORDER BY code,[crea_date],[quantity]) AS [RN]FROM [myTable] )QWHERE Q.RN=1
Ce-am pe mine am si-n dulap, cand ma-mbrac zici ca ma mutsabinWeb