To achieve the dynamic table you're aiming for, you can use SQL's YEAR() and MONTH() functions to group records by month and year. Then, use GROUP BY...