0
我現在從我的DB拉不同的「標籤」(小寫)的列表,用下面的SQL:如何計算每個不同的值的出現
SELECT DISTINCT(LOWER(tag)) AS tag FROM user.tags ORDER BY LOWER(tag);
我想第二個列添加到我的結果,其統計每個標籤的出現次數。因此,不是又回到:
tag:
'test'
'sample'
'example'
我會得到:
tag: count:
'test' 3
'sample' 2
'example' 7
請在'組by'一些研究和'計數()'。 –