以下面两个案例介绍distinct、group by的底层原理。
【案例 1】去重计数案例
select count(1) from(
select age
from student
group by age
)b
【案例2】简化的去重计数
select count(distinct age)
from student
以下面两个案例介绍distinct、group by的底层原理。
【案例 1】去重计数案例
select count(1) from(
select age
from student
group by age
)b
【案例2】简化的去重计数
select count(distinct age)
from student