原链接:https://www.cnblogs.com/zeze/p/7845913.html 作为原作者
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
DELETE a FROM settle_merchant_sku_goods a, ( SELECT max( id ) id FROM settle_merchant_sku_goods WHERE merchant_order_id IN ( '1111111', '156385861517620505', '156440014487639310' ) GROUP BY merchant_order_id, merchant_order_skus_id ) t WHERE a.id = t.id
也支持left join.