56,677
社区成员
发帖
与我相关
我的任务
分享
select u.name,t.realmoney,umr.money from user u
left join
(select uid,sum(realmoney) as realmoney from trade group by uid) t on t.uid = u.id
left join
(select uid,sum(money) as money from user_money_record group by uid) umr on umr.uid = uid
select u.realname,u.money,
(select sum(realmoney) from trade_history where uid=u.id) as totalMoney,
(select sum(money) from user_money_record where uid=u.id) as allMoney
from user u
select *,
(select sum(realmoney) from trade where uid=u.id),
(select sum(money) from user_money_record where uid=u.id)
from user表 u
select *,
(select sum(realmoney) from trade where uid=u.id),
(select sum(money) from user_money_record where uid=u.id)
from user表 u