I have a table with following format.
USER_ID | START_TIME | END_TIME |
---|---|---|
AAA001 | 2020-04-04 09:04:27.000 | 2020-04-04 09:08:34.000 |
I need to split the duration between START_TIME and END_TIME by adding a one minute slots as a new column such that for each minute i have a unique row. The result I want to see like this:
USER_ID | START_TIME | END_TIME | MINUTE_SLOT |
---|---|---|---|
AAA001 | 2020-04-04 09:04:27.000 | 2020-04-04 09:08:54.000 | 2020-04-04 09:05:27.000 |
AAA001 | 2020-04-04 09:04:27.000 | 2020-04-04 09:08:54.000 | 2020-04-04 09:06:27.000 |
AAA001 | 2020-04-04 09:04:27.000 | 2020-04-04 09:08:54.000 | 2020-04-04 09:07:27.000 |
AAA001 | 2020-04-04 09:04:27.000 | 2020-04-04 09:08:54.000 | 2020-04-04 09:08:27.000 |
AAA001 | 2020-04-04 09:04:27.000 | 2020-04-04 09:08:54.000 | 2020-04-04 09:09:27.000 |
If anyone can tell me is this possible and how to do this in snowflake, that would be much appreciated, thanks!