标签:
update vouchers b ,(
select a.id from vouchers a where a.reason=‘XX‘ and a.id not in (
select minid from (
SELECT
min(id)minid,
userid
FROM
vouchers
WHERE
reason = ‘XX‘
GROUP BY
userid
) ss ) ) c set b.isdel=1 where b.id =c.id
标签:
原文地址:http://my.oschina.net/phacks/blog/421017