通过与任意组合选择计数组
有这个查询:
select town, count(town)
from user
group by town
它返回
Town Count
Copenhagen 5
NewYork 6
Athens 7
但我想要一个额外的行来显示所有城镇的编号:
Town Count
Copenhagen 5
NewYork 6
Athens 7
All 18
There is this query:
select town, count(town)
from user
group by town
which returns
Town Count
Copenhagen 5
NewYork 6
Athens 7
But I would like an additional line which shows all towns number:
Town Count
Copenhagen 5
NewYork 6
Athens 7
All 18
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可能不是最好的方法,但我相信这应该有效:
Probably not the best way, but I believe this should work: