Answer the question
In order to leave comments, you need to log in
How to split date period by seconds?
Hello everyone Tell me
, pliz, there is such data consisting of two columns. Time from and time to.
It is required to break the line into periods by seconds.
That is, the first line:
from 10/01/2021 00:00:05 to 10/01/2021 00:00:09
and you need to create new lines below that will go by seconds 06, 07, 08. Can this be done when uploading data in SQL? or already during processing, for example, in Power BI or using Pandas.
I will be grateful for any help.
Answer the question
In order to leave comments, you need to log in
Of course it is possible. Here is one possible option directly in Postgresql:
select generate_series(start_time, end_time, interval '1 second'), t.*
from t
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question