池州城乡住房建设厅网站买友情链接
查询重复数据的条数
select name , count(*) from table group by name;
查询结果:查询表table中name相同重复的个数
补充:count的用法
查询一个表中总共多少行(多少条数据)
select count (*) from table
小结
count 属于聚合函数,类似的聚合函数sum(),avg(),max(),min();
count() :计数
sum() :求和
avg() : 平均数
max() : 最大值
min() : 最小值
聚合函数配合group by 使用