Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 |
Tags
- matplotlib
- function
- sklearn
- count()
- wcss
- 최댓값
- list
- insert()
- 덴드로그램
- elbow method
- append()
- Dictionary
- 최솟값
- IN
- DataAccess
- pandas
- Machine Learning
- data
- string
- numpy
- Python
- analizer
- DataFrame
- 반복문
- hierarchical_clustering
- len()
- 분류 결과표
- nan
- del
- dendrogram
Archives
- Today
- Total
개발공부
[MySQL] 조건문 IF 본문
IF(조건, 참일 경우 반환 값, 거짓일 경우 리턴 값)
예제
books 테이블

pages 가 300 이상이면 'long' 그렇지 않으면 'short'라는 result 컬럼을 만들어 출력하라
select *, if(pages >= 300, 'long', 'short' ) as result
from books;

'Database > MySQL' 카테고리의 다른 글
| [MySQL] 다른 테이블을 참조(Reference)하는 foreign key 설정하는 방법 (0) | 2022.05.17 |
|---|---|
| [MySQL] NULL 값을 처리하는 함수 IFNULL() (0) | 2022.05.17 |
| [MySQL] 조건문 CASE (0) | 2022.05.17 |
| [MySQL] 날짜 데이터 연산 datediff(), date_add(), +, - (0) | 2022.05.16 |
| [MySQL] 날짜 형식을 바꾸는 date_format() (0) | 2022.05.16 |