2

I would like to filter my data within a time interval but in consecutive days for a determined amount of days. I know I can achieve that using

select insert_datetime from table WHERE insert_datetime IN '2022-09-02T01:00:00;10m'
UNION ALL
select insert_datetime from table WHERE insert_datetime IN '2022-09-03T01:00:00;10m'

But is there another way to got the same result avoiding the UNION ALL?

Cgra
  • 23
  • 2

1 Answers1

7

You can achieve that using the extra parameters for the IN clause.

select insert_datetime from table WHERE insert_datetime IN '2022-09-02T01:00:00;1m;1d;2'

Using this you are saying that you want your data to be filtered every day (1d) and do this for 2 times. There's an issue to add it to the documentation here