mysql update 子查询作为条件
UPDATE t_commission_template tct
JOIN (
SELECT
max(id) maxid
FROM
t_commission_template
WHERE
taken_mode = 1
AND t_commission_id = 6
GROUP BY
contract
) temp ON temp.maxid = tct.id
SET tct.open_position_bymoney = 0,
tct.open_position_bylot = 0,
tct.close_position_bymoney = 0,
tct.close_position_bylot = 0,
tct.close_position_today_bymoney = 0,
tct.close_position_today_bylot = 0