0

I have this data

Name startDate endDate
Andy 2023-06 2023-09

Can I loop depending on the different between startDate and endDate, so that my result looks like this

Name joinDate
Andy 2023-06
Andy 2023-07
Andy 2023-08
Andy 2023-09

So far I could not find solution in google or maybe my search keyword is incorrect. This is my first time asking in stackoverflow, let me know if I have anything wrong in my question. Thank you

Southern
  • 1
  • 1
  • Something like `select a.name, joinDate from table a cross join (select generate_series(startDate, endDate, interval '1 day') joinDate from table b where b.name = a.name) x` – Bohemian Jul 23 '23 at 02:28

0 Answers0