Skip to content

Tag: intervals

Hive SQL – time interval in 5 minutes

My data is too large to analyze since it is collecting every second or so. To reduce the data, I will like to group into interval of 5 minutes. I tried converting into unix timestamp and reverting it back, but didn’t work. I tried something like this Original data or output Desired output Answer I don’t know Hive, but make

MySql using interval with a list of dates

I’m willing to fetch all the dates that are listed in the list reducing 1 day I’m trying something like that: I wish to receive: ‘2022-03-21’, ‘2022-03-17’, ‘2022-03-10’ Answer It can be done with intervals. Here is a link to how it works : You can also do it with a concat for example :

SQL: Split time interval into intersects of one hour

I am new to SQL, where I am trying to split time intervals into multiple rows of one hour, together with an indicator of how many minutes the interval overlaps each hour. My data: What I would like: What would be the easiest/fastest way to do this? Answer Try something like this: demo Result for sample data