Title
#users-public
j

Jack

09/01/2022, 7:33 PM
Hello - is there a way to query where timestamp is in multiple dates? e.g. ts in ('2022-01-01', '2022-01-02') - It seems to only return timestamps that are midnight UTC...rather than everything for the day?
j

javier ramirez

09/02/2022, 8:10 AM
Hi. As detailed in the docs, when you do a multiple IN it falls back to standard
SQL IN,
so it is equivalent to do an
OR
with
=
semantics
8:12 AM
Your query is equivalent to
WHERE ts = '2022-01-01' OR ts = '2022-01-02'
8:12 AM
what you can do, is doing the
OR
with
IN
yourself, as in
WHERE ts IN '2022-01-01' OR ts IN '2022-01-02'
j

Jack

09/02/2022, 8:13 AM
ok thanks - It seems more performant to do a UNION ALL with 2 selects where ts = '<DATE>'
j

javier ramirez

09/02/2022, 8:14 AM
if you use =, you will get only midnight results
8:14 AM
you need to use IN
j

Jack

09/02/2022, 8:14 AM
ok thanks