Syntax
DAYOFMONTH(date)
Purpose
DAYOFMONTH() returns the ordinal number of the day in the month of date.
Examples
obclient> SELECT DAYOFMONTH('2008-12-31');
+--------------------------+
| DAYOFMONTH('2008-12-31') |
+--------------------------+
| 31 |
+--------------------------+