select year month mysql code example Example: mysql select month and year Click to copySELECT DATE_FORMAT(test_date,'%Y%m') AS date FROM test_table;