SELECT hostname(mytable.url), COUNT (mytable.id) AS ct
FROM mytable
GROUP BY hostname(mytable.url)
ORDER BY ct DESC;
1
2
3
4
SELECT hostname (mytable.url), COUNT(mytable.id) AS ct
FROM mytable
GROUP BY hostname (mytable.url)
ORDER BY ct DESC;
您还可以创建聚合函数,它接受 0..n 值,并 生成一个单个输出值。例子可能是计算标准偏差、通过用一些方式处理值来产生字符串、或者做一些类型 的分类等等。