Help - Search - Members - Calendar
Full Version: Mysql Question- Display Only Rows That Appear The Most?
Zymic Webmaster Forums > Zymic Free Web Hosting > Databases & MySQL
Firstbaysmith
Suppose I have girl scounts database and want to do display only the girl scout with the most badges and the list of the badge names. How would I do that? I've look at a lot of places and tried different methods i.e. max count, putting things in descending order and trying to find a command for the first row....etc. none of them seem to work..

Thanks!
Jacob
Something like this would work:
SQL
SELECT `name`, `badges` FROM `table` ORDER BY `badges` DESC;
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.