This is a discussion on selecting the single most common value from a certain column? within the MySQL Database forums, part of the Database Forums category; Hi is there a way of selecting the single most common value from a certain column in a mysql table? ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Ciaran wrote:
> Hi is there a way of selecting the single most common value from a > certain column in a mysql table? > > Thanks a lot, > Ciarán SELECT column_name, count(*) as quantity FROM table_name GROUP BY column_name ORDER BY quantity DESC LIMIT 1 |
![]() |
| Thread Tools | |
| Display Modes | |
|
|