从列中选择最常见的

发布于 2024-09-06 21:16:54 字数 172 浏览 2 评论 0原文

您好
我在表中有一个列,我想从所选列中选择最常见的项目。桌子已摆好 :

  • id
  • TitlePublished
  • Publication

我希望能够选择出版物发布频率最高的位置。这可以吗?
提前致谢
院长

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 possible to do?

Thanks in Advance

Dean

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

べ繥欢鉨o。 2024-09-13 21:16:54
select published, count(*) nbr
from table1
group by published
order by nbr desc
limit 1

您实际上并不需要计数,但如果您想确认该选择似乎合理,您可以使用它。另外,您没有具体说明您是否只想要一个,或者想查看哪一个是最频繁的,以及其他记录的频率。如果您想查看所有记录,请取消限制 1

select 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文