MySQL query deduplication

Method 1:

distinct

select count(distinct CName) from Course

 

Method two:

Using grouping group by

select count(1) from Course group by CName

 

Leave a Reply

Your email address will not be published. Required fields are marked *