请教下你select id,a+b as zongshu from table order by a+b这句话中id怎么来的???
如果这个id有合理的来源,后面的语句可以如下写
select A.c+B.c as t from (select count(*) as c from Table_1 where TypeId='评论') A,(select count(*) as c from Table_1 where TypeId='留言') B order by t DESC
果断解决问题
select id,(a+b) as zongshu from table order by zongshu
经测试正确