Re: [druid-user] Re: Difference between two Intervals?

I’m not sure where you’re doing this exactly, but for the record, I wanted to note that it wouldn’t be hard using druid sql, either. iiuc, pseudo-code would be something like:

WITH t1 AS
(SELECT query for interval 1),
t2 AS
(SELECT query for interval 2)
SELECT t2.val - t1.val FROM t1, t2
WHERE t2.val IS NOT NULL
UNION ALL
SELECT 0 FROM t1,t2 WHERE t2.val IS NULL

or something like that…