mysql_num_rows question

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
jammr
Forum Newbie
Posts: 16
Joined: Mon Jan 22, 2007 12:10 am

mysql_num_rows question

Post by jammr »

I'm trying to write a script to check a table to see which number is the "most popular" per se. I basically want to show the top 10 most popular X based on the number of that number in the row, if that's understandable. I'm having trouble visualizing how I would write this...

Thanks for reading this,
thanks in advance for any help on this..
User avatar
aaronhall
DevNet Resident
Posts: 1040
Joined: Tue Aug 13, 2002 5:10 pm
Location: Back in Phoenix, missing the microbrews
Contact:

Post by aaronhall »

Something like

Code: Select all

SELECT row, COUNT(row) as occurrences FROM table GROUP BY row
jammr
Forum Newbie
Posts: 16
Joined: Mon Jan 22, 2007 12:10 am

Post by jammr »

Thanks for the help :D I appreciate it.
Post Reply