Using Distinct in SQL Update

后端 未结 4 1263
难免孤独
难免孤独 2021-01-13 04:07

Here is the Select I need to convert to an Update:

SELECT DISTINCT f.SectionID, f.Name, v.Enabled
FROM SETTING_VALUE v
INNER JOIN SETTING s ON v.SettingID =          


        
4条回答
  •  走了就别回头了
    2021-01-13 04:47

    UPDATE SETTING_VALUE
       SET Enabled = 0
     WHERE DisplayValue LIKE '%Miami%'
           AND EXISTS (
                       SELECT *
                         FROM SETTING s 
                        WHERE SETTING_VALUE.SettingID = s.SettingID
                              AND EXISTS (
                                          SELECT *
                                            FROM LU_FIELD f 
                                           WHERE f.FieldID = s.FieldID
                                                 AND f.ControlName LIKE '%City%'
                                         )
                      );
    

提交回复
热议问题