Jump to: navigation, search

Mysql MONTH

From w3cyberlearnings

Contents

MySQL MONTH Function

This function returns month from date or datetime expression.

Syntax MONTH

  • expre: date or datetime expression
MONTH(expre);

Example 1

mysql> select month('2012-05-20');
+---------------------+
| month('2012-05-20') |
+---------------------+
|                   5 |
+---------------------+
1 row in set (0.00 sec)

Example 2

mysql> select month('2012-05-20 10:40:33');
+------------------------------+
| month('2012-05-20 10:40:33') |
+------------------------------+
|                            5 |
+------------------------------+
1 row in set (0.00 sec)

Related Links



Navigation
Web
SQL
MISC
References