统计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
相似回答