MysqlSELECTyear (curdate (); + ----------------- + | year (curdate () | + year + | 2009 | + ----------------- + 1 rowinset (0.00sec) mysqlSELECTmonth (curdate ()); + ------------------ + | month (curdate () | + ------------------ +
Mysql SELECT year (curdate (); + ----------------- + | year (curdate () | + ----------------- + | 2009 | + ----------------- + 1 row in set (0.00 sec) mysql SELECT month (curdate (); + ---------------- + | month (curdate () | + ------------------ +
Mysql> SELECT year (curdate ());
+ ----------------- +
| Year (curdate () |
+ ----------------- +
| 1, 2009 |
+ ----------------- +
1 row in set (0.00 sec)
Mysql> SELECT month (curdate ());
+ ------------------ +
| Month (curdate () |
+ ------------------ +
| 8 |
+ ------------------ +
1 row in set (0.00 sec)
Mysql> SELECT day (curdate ());
+ ---------------- +
| Day (curdate () |
+ ---------------- +
| 9 |
+ ---------------- +
1 row in set (0.00 sec)
Mysql> SELECT curdate ();
+ ------------ +
| Curdate () |
+ ------------ +
| 2009-08-09 |
+ ------------ +
1 row in set (0.00 sec)
Mysql> SELECT dayofmonth (curdate ());
+ ----------------------- +
| Dayofmonth (curdate () |
+ ----------------------- +
| 9 |
+ ----------------------- +
1 row in set (0.00 sec)