mysql一对多统计数据

每个文章,每个人对其进行评分,计算每个文章评分总和

 

select Aclass,(select sum(Bid) as Bclassnum from tabB where Bclass=Aclass) as Aclassnum from tabA order by Aclassnum desc

posted @ 2021-04-01 10:13  程序员小艺  阅读(383)  评论(0编辑  收藏  举报