Hello everyone, I have two table A and B and join ...
# random
n
Hello everyone, I have two table A and B and join them using interval join with logic
Copy code
B LEFT JOIN A ON B.ID = A.ID AND  B.TIME BETWEEN A.TIME - INTERVAL '10' MINUTE and A.TIME
I expected the query return value whenever table B has new value even if there is no match case from table A. However, when an event of table B with B.TIME>A.TIME, the query does not emit any value. Can you guys explain this behavior?
l
the expression
B.TIME BETWEEN A.TIME - INTERVAL '10' MINUTE and A.TIME
can't be true if A is null; it will either return
null
or
false
(probably
null
, if i had to guess); you might be able to use
coalesce(..., true)
to make that work though