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
- del
- 최솟값
- pandas
- sklearn
- Python
- numpy
- Dictionary
- wcss
- analizer
- 분류 결과표
- IN
- count()
- len()
- 최댓값
- DataAccess
- string
- nan
- matplotlib
- dendrogram
- hierarchical_clustering
- Machine Learning
- append()
- 반복문
- 덴드로그램
- DataFrame
- function
- data
- elbow method
- list
- insert()
Archives
- Today
- Total
개발공부
[MySQL] 시간 데이터 년, 월, 일, 시, 분, 초, 요일 가져오기 본문
people 테이블

년 가져오기 year()
select name, year(birthdate)
from people;

월 가져오기 month()
select name, day(birthdate)
from people;

일 가져오기 day()
select name, day(birthdate)
from people;

요일 가져오기 dayofweek()
일요일 = 1, 월요일 = 2, 화요일 = 3, 수요일 = 4,
목요일 = 5, 금요일 = 6, 토요일 = 7
select name, dayofweek(birthdate)
from people;

요일 이름 가져오기 dayname()
select name, dayname(birthdate)
from people;

시 가져오기 hour()
select name, hour(birthtime)
from people;

분 가져오기 minute()
select name, minute(birthtime)
from people;

초 가져오기 second()
select name, second(birthtime)
from people;

'Database > MySQL' 카테고리의 다른 글
| [MySQL] 날짜 데이터 연산 datediff(), date_add(), +, - (0) | 2022.05.16 |
|---|---|
| [MySQL] 날짜 형식을 바꾸는 date_format() (0) | 2022.05.16 |
| [MySQL] 현재 시간과 관련된 함수 curdate(), curtime(), now() (0) | 2022.05.16 |
| [MySQL] 시간 관련 데이터 타입 date, time, datetime, timestamp (0) | 2022.05.16 |
| [MySQL] 데이터 별로 묶기 group by, 데이터의 개수 count(), 합계 sum() 최댓값 max(), 최솟값 min(), 평균 값 avg() (0) | 2022.05.16 |