首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > Mysql >

MySql count 去掉反复

2012-07-05 
MySql count 去掉重复1.select count(distinct CName) from Course2.select count(CName) from (select di

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

热点排行