select cd_tabela, count(*) from tb_comentario where nm_tabela='tb_post' group by cd_tabela order by count(*) desc
select a.cd_post, a.nm_titulo, a.ds_post from tb_post a, tb_comentario b where b.nm_tabela='tb_post'
and b.cd_tabela=a.cd_post group by b.cd_tabela order by count(*) desc limit 0,3
Nenhum comentário:
Postar um comentário