发布网友
共1个回答
热心网友
不知道你是怎么存的,按
id, content, pid
评论ID,内容,上级评论ID
这种
select *
from table a,
(select pid, count(*) n from table b group by pid) c
where a.id=c.pid
order by c.n desc, a.id;