Thursday, 10 April 2014

Update using multiple conditions from multiple tables

update bom_operation_resources  set
usage_rate_or_amount = 0,
usage_rate_or_amount_inverse = 0
where exists (select c.usage_rate_or_amount,c.usage_rate_or_amount_inverse
from bom_operational_routings a,
bom_operation_sequences b,
bom_operation_resources c,
mtl_system_items d
where a.routing_sequence_id = b.routing_sequence_id
and b.operation_sequence_id = c.operation_sequence_id
and d.inventory_item_id = a.assembly_item_id
and a.organization_id = d.organization_id
and d.segment1 like 'FG%'
and bom_operation_resources.operation_sequence_id =c.operation_sequence_id)
--and c.operation_sequence_id = 3759) 

No comments:

Post a Comment