1、distinct
select count(distinct CName) from tebleselect count(CName) from (select distinct CName from Course) as temp SELECT DISTINCT text_zhcn FROM dms_menuconfig -- 去重查询表中数据
2、group by
select count(1) from Course group by CName
本文共 283 字,大约阅读时间需要 1 分钟。
1、distinct
select count(distinct CName) from tebleselect count(CName) from (select distinct CName from Course) as temp SELECT DISTINCT text_zhcn FROM dms_menuconfig -- 去重查询表中数据
2、group by
select count(1) from Course group by CName
转载于:https://www.cnblogs.com/lu2527/p/10824847.html