반응형
Distinct
pandas data frame의 unique와 같다.
컬럼이름 왼쪽에 작성한다.
author_lname의 이름을 중복없이 가져오기
select author_lname
from books;

select distinct author_lname
from books;

작가의 full_name을 중복없이 가져오기
select distinct concat_ws(' ', author_fname, author_lname) as full_name
from books;

반응형
'TOOL > MySQL' 카테고리의 다른 글
| MySQL - Paging (limit & offset) (0) | 2022.05.16 |
|---|---|
| MySQL - Order by (데이터 정렬) (0) | 2022.05.16 |
| MySQL - DELETE (0) | 2022.05.15 |
| MySQL - UPDATE (0) | 2022.05.15 |
| MySQL - Select ( slicing / concat / replace / reverse / char_length / upper / lower ) (0) | 2022.05.15 |