当前位置:Gxlcms > 数据库问题 > Mysql下SELECT的结果集作为UPDATE的WHERE条件时的SQL语法

Mysql下SELECT的结果集作为UPDATE的WHERE条件时的SQL语法

时间:2021-07-01 10:21:17 帮助过:4人阅读

UPDATE `WarningSendMail` AS alias_1 INNER JOIN (SELECT * FROM `WarningSendMail` WHERE flag=1 AND topic_id LIKE "%2267%") AS alias_2 SET alias_1.topic_id = REPLACE(alias_1.topic_id,‘|2267‘,‘‘) WHERE alias_1.id = alias_2.id



update WarningSendMail set topic_id= REPLACE(topic_id,‘|2267‘,‘‘) WHERE id IN ( SELECT id FROM WarningSendMail WHERE flag=1 AND topic_id LIKE "%2267%" );

  

Mysql下SELECT的结果集作为UPDATE的WHERE条件时的SQL语法

标签:select   set   sel   mail   warnings   and   end   highlight   条件   

人气教程排行