programmers lv.2 중복제거하기
distinct 는?
- 중복된 데이터를 제거하여 유일한 값만을 반환할 때 사용한다.
when?
select distinct name
from table
select distinct name1, name2
from table
name1와 name2의 조합이 중복되지 않는 행들이 반환.
-⭐️ 집계 함수와 함께 ⭐️
select count(distinct name) as name
from table
select distinct count(name) 은 틀린코드이다.