SELECT DATE_FORMAT( CONCAT( years.y, '-', months.m, '-01' ), '%Y-%m' ) AS MONTH, LAST_DAY( CONCAT( years.y, '-', months.m, '-01' )) AS month_end FROM ( SELECT 2023 AS y UNION SELECT 2024 UNION SELECT 2025 ) AS years CROSS JOIN ( SELECT 1 AS m UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9 UNION SELECT 10 UNION SELECT 11 UNION SELECT 12 ) AS months order by month