Forum Moderators: open
I need to list the TOP 5 commented forums. This is my current query:
SELECT forum.id_forum,COUNT(*) AS q FROM forum_msg INNER JOIN forum ON forum_msg.id_forum=forum.id_forum GROUP BY forum.id_forum
Any ideas on how to improve it? Thanks!
SELECT forum.id_forum,COUNT(forum_msg.*) AS q FROM forum_msg INNER JOIN forum ON forum_msg.id_forum=forum.id_forum GROUP BY forum.id_forum order by q desc limit 5
I think I am counting the right table.
[edited by: Demaestro at 8:19 pm (utc) on May 14, 2009]