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
时间: 2024-11-14 12:30:24