B表 id smoney sid 1 100 1 2 200 1 3 150 2 希望得到的结果: sid sname smoney 1 kkkkkkd 300(100+200) 2 ahuinan 150 参考: select A.Sname,sum(B.Smoney) As Smoney from dichan_item B inner join dichan_user A on B.Suserid=A.id group by B.Suserid,A.Sname order by sum(B.Smoney)