这是我需要转换为更新的选择:
SELECT DISTINCT f.SectionID, f.Name, v.Enabled FROM SETTING_VALUE v INNER JOIN SETTING s ON v.SettingID = s.SettingID INNER JOIN LU_FIELD f ON f.FieldID = s.FieldID WHERE v.DisplayValue LIKE '%Miami%' AND f.ControlName LIKE '%City%'
我的尝试:
UPDATE SETTING_VALUE SET Enabled = 0 FROM SETTING_VALUE v INNER JOIN SETTING s ON v.SettingID = s.SettingID INNER JOIN LU_FIELD f ON f.FieldID = s.FieldID WHERE v.DisplayValue LIKE '%Miami%' AND f.ControlName LIKE '%City%'
不确定如何申请Distinct
根据您的评论,all of the matching rows should be updated您不需要区分。只需执行以下命令:
all of the matching rows should be updated
您选择的所有内容都会更新。