Skip to content
Advertisement

Get All dates for given month and year and join in same table sql

Currently I have data in below format in my table

enter image description here

How can I get date wise for every month and year like below

enter image description here

Advertisement

Answer

First, personally, I would create a Calendar Table. You can quickly create a simple one with the below:

Then is just a trivial case of joining your table to the calendar table:

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement