1. 程式人生 > >去重查詢表mysql 中數據

去重查詢表mysql 中數據

tin ble -- 數據 class distinct text lec course

1、distinct

select count(distinct CName) from teble
select 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

去重查詢表mysql 中數據