mysql – Update the query of a field with data from another table


I have the main table and the detailed table

Master
inv_id
numéro_inv
inv_totalCost

Detail
idt_id
idt_invMasterNumber
idt_productId
idt_quantity
idt_productUnitCost
idt_productTotalCostItem

there is a one to many relationship

master.inv_number -> detalle.idt_invMasterNumber

I need to update the field master.inv_totalCost with the sum of detalle.idt_productTotalCostItem all records that meet the condition master.inv_number = detalle.idt_invMasterNumber

Thank you for you precious help!