웹이야기

MySQL DAYOFYEAR() 본문

D/MySQL

MySQL DAYOFYEAR()

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

MySQL 날짜함수, 시간함수

 

DAYOFYEAR()

   - 년을 기준으로 해서 몇번째 일인지를 return.

 

DAYOFYEAR(date)

 

 

Retruns the day of the year for date, in the range 1 to 366.

 

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

 

 

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

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

MySQL FROM_DAYS()  (0) 2020.04.01
MySQL EXTRACT()  (0) 2020.04.01
MySQL DAYOFWEEK()  (0) 2020.04.01
MySQL DAYOFMONTH()  (0) 2020.04.01
MySQL DAYNAME()  (0) 2020.04.01
Comments