读书人

MySql count 去掉反复

发布时间: 2012-07-05 07:59:18 作者: rapoo

MySql count 去掉重复

1.

select count(distinct CName) from Course

2.

select count(CName) from (select distinct CName from Course) as temp

as可有可无。temp作为别名,若无则提示错误:1248 Every derived table must have its own alias

读书人网 >Mysql

热点推荐