I have a SQL update statement which does what it's supposed to. However, I have a feeling that the way I wrote it isn't the best. I am not highly experienced in SQL so any pointers or hints on how can I rewrite this statement and possibly get rid of the duplicate joins (joining on same tables again in the where statement is what bothers me about this update statement) would be helpful.
UPDATE Item SET AttachementID = NULL
FROM Item i
JOIN BidItem ebi ON i.BidItemID = ebi.BidItemID
JOIN Group eg ON ebi.GroupID = eg.GroupID
WHERE eg.EstimateID = @JobID and i.AttachementID NOT IN (
SELECT i.ItemID FROM Item i
JOIN BidItem ebi ON i.BidItemID = ebi.BidItemID
JOIN Group eg ON ebi.GroupID = eg.GroupID
WHERE eg.EstimateID = @JobID
)