Hi
i have a columm in the table and i want to select the most common item from the selected column. The table is set up publication:- id
- Title
- published
I want to beable to select the most recurring places where publications have been published. Is this 开发者_JS百科possible to do?
Thanks in Advance Deanselect published, count(*) nbr
from table1
group by published
order by nbr desc
limit 1
You don't really need the count, but if you wanted confirmation that the choice seemed reasonable, you could use it. Also, you didn't specifically say whether you wanted ONLY the one, or wanted to see which was the most frequent, along with frequencies of the other records. Take off the limit 1
if you want to see all records.
精彩评论