PDA

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


Lesane
12-11-2001, 08:56 AM
Does someone know the query to get the user that started the most threads? :)

Thanks.

Admin
12-11-2001, 09:10 AM
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
12-11-2001, 09:28 AM
Thank you very much Firefly.

This is the result :)

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

Admin
12-11-2001, 09:42 AM
Tight. :)