还是问一个mysql的查询汇总的汇总问题
用户表tu
得分表t
SQL:SELECT tu.uid,t.score,a.total from test t right join test_user tu on tu.uid=t.uid left join (SELECT uid,sum(score) as total from test group by uid) a on a.uid=t.uid order by tu.uid
结果
发布时间: 2013-12-23 14:30:52 作者: rapoo
还是问一个mysql的查询汇总的汇总问题
用户表tu
得分表t
SQL:SELECT tu.uid,t.score,a.total from test t right join test_user tu on tu.uid=t.uid left join (SELECT uid,sum(score) as total from test group by uid) a on a.uid=t.uid order by tu.uid
结果