I need to update a field with values that another field already has
i have this script
UPDATE [Tabla2].[dbo].[tblmvto_lotes]
SET peso = T2.peso
FROM [Tabla2].[dbo].[tblmvto_lotes] T1, [Tabla1].[dbo].[tblmvto_lotes] T2
WHERE T1.codlote = T2.codlote
that updates the weight field but when executed it puts all the weights the same
As you can see, what I need is for the weights to be updated in order according to the animal, not for me to put the first weight on all
Your join condition is wrong... if you only join for the codlot field, in which they are all the same, it will update with the first value it finds.
Your join condition must be codlote and animal, as follows: