84669 personnes étudient
152542 personnes étudient
20005 personnes étudient
5487 personnes étudient
7821 personnes étudient
359900 personnes étudient
3350 personnes étudient
180660 personnes étudient
48569 personnes étudient
18603 personnes étudient
40936 personnes étudient
1549 personnes étudient
1183 personnes étudient
32909 personnes étudient
对uid 相同的记录的money 求和
比如uid 387 的记录 结果uid 金额 求和的金额387 2000.00 5000.00387 3000.00 5000.00
因为我需要记录的明细 所有不能用group by
走同样的路,发现不同的人生
我知道SQL语法很强大,不过我也不是很精通,针对你的需求,我提供如下参考意见。
select a.uid,a.money,c.total_money from (select b.uid,sum(b.money) as total_money from leshi_deal_invest as b group by b.uid) as c right join leshi_deal_invest as a on a.uid = c.uid;
select b.uid, b.money, a.total from (select uid, sum(money) as total from test group by uid) as a, test as b where a.uid = b.uid
够懒的
够懒的