Maverickb7 Posted April 13, 2006 Share Posted April 13, 2006 I was wondering if someone could help me with something. I have a table in my database and within one of the columns is the user id of whom ever created the row. Now what I would like to do is display the top x posters. So I need to somehow count how many times each user id is listed then display the top x users. Does anyone know how I would go about doing this? Quote Link to comment Share on other sites More sharing options...
.josh Posted April 13, 2006 Share Posted April 13, 2006 SELECT username, count( * ) AS blah FROM tablename GROUP BY username ORDER BY blah DESC LIMIT 10 you might have to play with that a bit but that should get you going. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.