sorry for the ot-ish post.
i've got a repairs table and a price master table. each has millions of
rows. i'm trying to optimize the query below. i think the best way would be
to use an update statement with a join but i can't remember the syntax. any
thoughts?
UPDATE Repair_Order_Li nes l ,
priceMaster p
SET l.IsOEM = 1
WHERE l.IsOEM = 0
AND
(
l.PartNumber = p.PartNumber
OR l.PartNumber = p.PrecedentPart Number
)
essentially, if a repair line has a part number in the price master table,
it is considered an OEM part. both the PartNumber columns and the
PrecedentPartNu mber column are VARCHAR(50). priceMaster is indexed on both.
tia,
me
i've got a repairs table and a price master table. each has millions of
rows. i'm trying to optimize the query below. i think the best way would be
to use an update statement with a join but i can't remember the syntax. any
thoughts?
UPDATE Repair_Order_Li nes l ,
priceMaster p
SET l.IsOEM = 1
WHERE l.IsOEM = 0
AND
(
l.PartNumber = p.PartNumber
OR l.PartNumber = p.PrecedentPart Number
)
essentially, if a repair line has a part number in the price master table,
it is considered an OEM part. both the PartNumber columns and the
PrecedentPartNu mber column are VARCHAR(50). priceMaster is indexed on both.
tia,
me
Comment