웹이야기

MySQL DAYOFWEEK() 본문

D/MySQL

MySQL DAYOFWEEK()

yeon.Biju 2020. 4. 1. 16:31

MySQL 날짜함수, 시간함수

 

DAYOFWEEK()

   - 주의 몇번째(weekday index) 인지를 return.

 

DAYOFWEEK(date)

 

Returns the weekday index for date(1=Sunday, 2=Monday.... 7=Saturday). These index value correspond to the ODBC standard.

 

mysql> SELECT DAYOFWEEK(NOW());
+------------------+
| DAYOFWEEK(NOW()) |
+------------------+
|                4 |
+------------------+
1 row in set (0.00 sec)

 

 


mysql> SELECT DAYOFWEEK('2020-04-01');
+-------------------------+
| DAYOFWEEK('2020-04-01') |
+-------------------------+
|                       4 |
+-------------------------+
1 row in set (0.00 sec)

'D > MySQL' 카테고리의 다른 글

MySQL EXTRACT()  (0) 2020.04.01
MySQL DAYOFYEAR()  (0) 2020.04.01
MySQL DAYOFMONTH()  (0) 2020.04.01
MySQL DAYNAME()  (0) 2020.04.01
MySQL DAY()  (0) 2020.04.01
Comments