I have a colmn in table containing the dates. I want to generate a table that contains a date range for every date in the column. For example, the table1 may look like this:
id mydate
1 06/07/2024
8 05/03/2024
I want a table from the above table as follows (2 days before and 2 days after for each date in mydate column:
id yourdate
1 06/09/2024
1 06/08/2024
1 06/07/2024
1 06/06/2024
1 06/05/2024
8 05/05/2024
8 05/04/2024
8 05/03/2024
8 05/02/2024
8 05/01/2024
There is a resolved simpler question here Generate a range of dates using SQL.