>;with cte as (select client.*, inv.AddUser as newUser, Inv.NoItem, > row_number() over (partition by Inv.NoClient order by Inv.Al DESC) as Rn from Client >inner join Invoice inv on Client.Numero = Inv.NoClient) > >update cte set NoProvince = newUser where Rn = 1 and NoItem = 23Thanks