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
- len()
- list
- count()
- analizer
- dendrogram
- 최솟값
- function
- 분류 결과표
- Dictionary
- hierarchical_clustering
- 최댓값
- elbow method
- pandas
- wcss
- DataFrame
- 반복문
- data
- string
- DataAccess
- sklearn
- matplotlib
- nan
- del
- insert()
- append()
- numpy
- Machine Learning
- 덴드로그램
- Python
- IN
Archives
- Today
- Total
개발공부
[MySQL] 날짜 형식을 바꾸는 date_format() 본문
예제
people 테이블

예제1.
birthdt 에서 시, 분, 초만 가져와 'HH:MM:SS 에 태어났습니다' 형태로 만들기
select date_format(birthdt, '%H:%i:%s 에 태어났습니다.')
from people;

예제 2.
birthdt 에서 년 월 일 시 분만 가져와'YYYY-MM-DD HH-MM 에 태어났습니다.' 형태로 만들기
select date_format(birthdt, '%Y-%m-%d %H:%i 에 태어났습니다.')
from people;

'Database > MySQL' 카테고리의 다른 글
| [MySQL] 조건문 CASE (0) | 2022.05.17 |
|---|---|
| [MySQL] 날짜 데이터 연산 datediff(), date_add(), +, - (0) | 2022.05.16 |
| [MySQL] 시간 데이터 년, 월, 일, 시, 분, 초, 요일 가져오기 (0) | 2022.05.16 |
| [MySQL] 현재 시간과 관련된 함수 curdate(), curtime(), now() (0) | 2022.05.16 |
| [MySQL] 시간 관련 데이터 타입 date, time, datetime, timestamp (0) | 2022.05.16 |