mysql select month and year from date code example
Example 1: mysql select month and year
SELECT DATE_FORMAT(test_date,'%Y%m') AS date FROM test_table;
Example 2: mysql extract days
SELECT EXTRACT(DAY FROM '2020-07-05')
SELECT DATE_FORMAT(test_date,'%Y%m') AS date FROM test_table;
SELECT EXTRACT(DAY FROM '2020-07-05')