mysql> select day('2020-01-01 18:10:10')
-> ;
+----------------------------+
| day('2020-01-01 18:10:10') |
+----------------------------+
| 1 |
+----------------------------+
1 row in set (0.00 sec)
mysql> select day('2020-01-21 18:10:10')
-> ;
+----------------------------+
| day('2020-01-21 18:10:10') |
+----------------------------+
| 21 |
+----------------------------+
1 row in set (0.00 sec)
mysql> select day('2020-10-21 18:10:10')
-> ;
+----------------------------+
| day('2020-10-21 18:10:10') |
+----------------------------+
| 21 |
+----------------------------+
1 row in set (0.00 sec)
mysql> select last_day('2021-01-01 12:12:01');
+---------------------------------+
| last_day('2021-01-01 12:12:01') |
+---------------------------------+
| 2021-01-31 |
+---------------------------------+
1 row in set (0.00 sec)
mysql> ;
ERROR:
No query specified
mysql> select last_day('2021-09-01 12:12:01');
+---------------------------------+
| last_day('2021-09-01 12:12:01') |
+---------------------------------+
| 2021-09-30 |
+---------------------------------+
1 row in set (0.00 sec)
mysql>
|