PDA

View Full Version : Sql Query: User that started the most threads


Lesane
11 Dec 2001, 09:56
Does someone know the query to get the user that started the most threads? :)

Thanks.

Chen
11 Dec 2001, 10:10
SELECT COUNT(*) AS count,postuserid,postusername FROM thread GROUP BY postuserid ORDER BY count DESC LIMIT 1;
Then count is the number of threads he has started, postuserid is his userID and postusername is his username.

Lesane
11 Dec 2001, 10:28
Thank you very much Firefly.

This is the result :)

http://www.lesane-crooks.com/board/topthreads.php

Chen
11 Dec 2001, 10:42
Tight. :)