|
Posted by Steve on 05/02/07 16:08
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_Lines l ,
priceMaster p
SET l.IsOEM = 1
WHERE l.IsOEM = 0
AND
(
l.PartNumber = p.PartNumber
OR l.PartNumber = p.PrecedentPartNumber
)
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
PrecedentPartNumber column are VARCHAR(50). priceMaster is indexed on both.
tia,
me
Navigation:
[Reply to this message]
|