일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Oracle
- 전자정부표준프레임워크
- String Functions and Operators
- 방화벽
- 티베로
- 윈도우
- HTTP
- 오라클
- Tibero
- Sring Functions and Operators
- 전자정부 표준프레임워크
- String Function and Operators
- MySQL
- String Functions and Date Operators
- Date and Time Functions
- SVN
- Date and Time Function
- Data and Time Functions
- Today
- Total
웹이야기
MySQL YEARWEEK() 본문
MySQL 날짜함수, 시간함수
YEARWEEK()
-
YEARWEEK(date), YEARWEEK(date, mode)
의 형태
Returns year and week for a date. The year in the result may be different form the year in the date argument for the first and the last week of the year.
The mode argument works exactll like the mode argument to WEEK(). For the single-argument syntax, a mode value of 0 is used. Unlike WEEK(), the value of default_week_format does not influence YEARWEEK().
mysql> SELECT YEARWEEK(NOW());
+-----------------+
| YEARWEEK(NOW()) |
+-----------------+
| 202014 |
+-----------------+
1 row in set (0.00 sec)
mysql> SELECT YEARWEEK('2020-04-05');
+------------------------+
| YEARWEEK('2020-04-05') |
+------------------------+
| 202014 |
+------------------------+
1 row in set (0.00 sec)
The week number is different from what the WEEK() function would return (0) for optional arguments 0 or 1, as WEEK() then returns the week in the context of the given year.
'D > MySQL' 카테고리의 다른 글
[MySQL] ASCII() (0) | 2020.04.08 |
---|---|
MySQL String Function and Operators (0) | 2020.04.07 |
MySQL YEAR() (0) | 2020.04.05 |
MySQL WEEKOFYEAR() (0) | 2020.04.05 |
MySQL WEEKDAY() (0) | 2020.04.05 |