如何获得表中不重复数据的数目?
select count(*) as num from 表名
这个可以算出来表中有多少条记录.
那么
如何获得表中不重复数据的数目?
比如表中有
id,name,type 三个字段
我想要的是在type这个字段中不重复的数据有多少条.如何做呢?
谢谢!!!!!!
[解决办法]
select count(distinct type) as num from 表名
发布时间: 2012-01-16 23:36:51 作者: rapoo
如何获得表中不重复数据的数目?
select count(*) as num from 表名
这个可以算出来表中有多少条记录.
那么
如何获得表中不重复数据的数目?
比如表中有
id,name,type 三个字段
我想要的是在type这个字段中不重复的数据有多少条.如何做呢?
谢谢!!!!!!
[解决办法]
select count(distinct type) as num from 表名