简体   繁体   English

查询以查找唯一行及其计数

[英]Query to find unique row and their count

Say I have a table with rows like,假设我有一个包含行的表,

A
B
A
C
D
D
A

I want a table from that with unique row and count.我想要一个具有唯一行和计数的表格。 So resultant table will be of two column like,所以结果表将是两列,

A 3
B 1
C 1
D 2

Having difficulty writing the query.难以编写查询。 Help?帮助?

SELECT column1, count(column1)
FROM [table]
GROUP BY column1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM