11智能在线
新记
统计mysql数据库一个字段中不同的记录总和???
比如mysql的一个数据库中,有个字段名为name,存放的数据有a,b,c,a,d,统计出来的结果就应该是3.
举报该文章
其他看法
第1个回答 2009-07-24
select distinct(name),count(*) from 表名
第2个回答 2009-07-24
select count(distinct name) from 表
第3个回答 2009-07-24
select count(distinct name) from table本回答被提问者采纳
第4个回答 2009-07-24
select count(distinct name) from tablename
相似回答
大家正在搜
相关问题
MYSQL统计某个字段总和方法?
mysql如何查询一个字段中不同数据出现的次数?
用sql语句统计数据库某个字段中相同的数据有多少条?
mysql一条sql统计某个字段不同值的个数
求一个统计数据库 所有表的记录条数的总和的语句(mysql)
mysql如何用SQL列出数据库某个字段中不同的值?
Mysql数据库一个字段内多个值如何统计个数
sql语句查询mysql数据库按条件得到总条数的同时得到某一...