UPDATE members SET money=money+100 WHERE username IN ( SELECT username FROM forum );
可以说,我想为我的每个成员在论坛中发给每个帖子100钱.该查询有效,但如果一个成员发布了多次,则只能得到100.有人可以更正此查询吗?
像这样
update members m set money=money+100*( select count(*) from forum f where f.username = m.username);