select * from 内容表 a order by (select count(*) from 评论表 where 内容的id=a.id) desc
斑竹这个SQL效率高吗?select * from dispatch_text, (select dispatch_id id ,count(1) countA from dispatch_order group by dispatch_id) as t1 where dispatch_text.dispatch_id=t1.id order by countA
from 内容表 a
order by (select count(*) from 评论表 where 内容的id=a.id) desc
(select dispatch_id id ,count(1) countA from dispatch_order group by dispatch_id) as t1
where dispatch_text.dispatch_id=t1.id
order by countA