本文介绍了计数mysql值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表,其中包含两个字段TAG_ID和TAG_DESC

I have a table with two fields, TAG_ID and TAG_DESC

我的主要是tag_id.

my primary is tag_id.

我正在寻找一个查询,该查询将显示每个TAG_DESC及其旁边出现的次数.

I'm looking for a query that will display each TAG_DESC and the amount of times it occurs next to it.

谢谢

推荐答案

  SELECT TAG_DESC as 'Description',
         COUNT(TAG_DESC) as 'Occurances'
    FROM table_name
GROUP BY TAG_DESC

这篇关于计数mysql值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-14 02:08