Is there a better solution to the one I found for this UPDATE statment?
UPDATE MyTable CF SET (CF.OrgId, CF.G_OrgId, CF.Status, TimeModified) =
(SELECT CT.BOrgId,CT.BGOrgId, CASE CT.BGOrgId WHEN '' THEN 302 ELSE 303 END, CURRENT TIMESTAMP FROM SESSION.My_Temp CT WHERE CT.Id = CF.Id AND CT.Operation = 'RUN')
WHERE CF.Id IN (SELECT CT.Id FROM SESSION.My_Temp CT WHERE CT.Id = CF.Id AND CT.Operation = 'RUN')
Basically I'm updated a table based on a values from a temp table. The target table can only be updated if the temp table values contain the target table ids.
This works but it seems silly to have to duplicate my select in order to achieve this. Is there a way to do an inner join on a select?