Pages

ngepress.com

Monday, December 27, 2021

ngepress.com


How to create a single date column from multiple date column with start date and end date?

Posted: 17 Dec 2021 03:11 AM PST

I have a table with this kind of data, with no overlapping dates:

id start_date end_date
1 2021-12-20 2021-12-20
2 2021-12-15 2021-12-18
3 2021-12-10 2021-12-11

I want to have output as:

id date
1 2021-12-20
2 2021-12-18
2 2021-12-17
2 2021-12-16
2 2021-12-15
3 2021-12-11
3 2021-12-10

I tried creating table with generated dates between range min(start_date) and max(end_date) and using join with WHERE date>=start_date and date<=end_date.

The post How to create a single date column from multiple date column with start date and end date? appeared first on Nge Press.

0 comments:

Post a Comment