웹이야기

MySQL DAYOFMONTH() 본문

D/MySQL

MySQL DAYOFMONTH()

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

MySQL 날짜함수, 시간함수

 

DAYOFMONTH()

   - 몇일인지를 return.

 

DAYOFMONTH(date)

의 형태

 

 

Returns the day of the month for date, in the range 1 to 31, or 0 for dates such as '0000-00-00' or '2008-00-00') that have a zero day part.

 

 

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

 


mysql> SELECT DAYOFMONTH('2010-05-10');
+--------------------------+
| DAYOFMONTH('2010-05-10') |
+--------------------------+
|                       10 |
+--------------------------+
1 row in set (0.00 sec)

 

mysql> SELECT DAYOFMONTH('2010-05-11 11:22:33');
+-----------------------------------+
| DAYOFMONTH('2010-05-11 11:22:33') |
+-----------------------------------+
|                                11 |
+-----------------------------------+
1 row in set (0.00 sec)


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

MySQL DAYOFYEAR()  (0) 2020.04.01
MySQL DAYOFWEEK()  (0) 2020.04.01
MySQL DAYNAME()  (0) 2020.04.01
MySQL DAY()  (0) 2020.04.01
MySQL DATE_SUB()  (0) 2020.04.01
Comments