你好 我在表格中有一个columm,我想从所选列中选择最常用的项目。 该表已设置发布:
ID 标题 发表我希望能够选择出版物已经出版的最经常出现的地方。 这可能吗? 提前致谢 院长
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 publishedI want to beable to select the most recurring places where publications have been published. Is this possible to do? Thanks in Advance Dean
最满意答案
select published, count(*) nbr from table1 group by published order by nbr desc limit 1你真的不需要计算,但如果你想确认选择似乎合理,你可以使用它。 此外,您没有具体说明您是否只想要一个,或者想要查看哪个是最频繁的,以及其他记录的频率。 如果要查看所有记录,请取消limit 1 。
select published, count(*) nbr from table1 group by published order by nbr desc limit 1You 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.
更多推荐
发布评论