是这样的一个情况 这里有三张表 分别是用户user,订单 trade ,和资金记录 user_money_record
现在要根据用户来统计他们的订单总金额和账户余额以及充值总金额
user表
id realname money
1 张xx 100
2 王xx 500
3 李xx 1500
trade
id uid realmoney
1 2 5000
2 1 1000
3 2 5000
4 3 10000
5 1 3500
user_money_record
id uid money
1 2 5000
2 1 5000
3 2 2000
4 2 3000
5 3 5000
6 3 5000
表结构及数据如上
求统计他们的订单总金额和账户余额以及充值总金额
谢谢!
I guess you may want to do this
If the information in the user table is the most complete, it should look like this:
How to deal with this situation if the amount of data is too large