You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using two saved PGSQL queries. Example using query_111 which is start and end (days, weeks, months, your choice) with a lateral join to query_222 counting events based on the periods from query_111. My attempts all seem to fail with an error.
select intervals.start
, intervals.end
, Summary.*
from query_111 intervals
left join lateral
(select
sum(case when (created < intervals.end) then 1 else 0 end) as active
sum(case when (closed > intervals.start) and (closed < intervals.end) then 1 else 0 end) as closed
from query_222
) Summary on true
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Using two saved PGSQL queries. Example using query_111 which is start and end (days, weeks, months, your choice) with a lateral join to query_222 counting events based on the periods from query_111. My attempts all seem to fail with an error.
select intervals.start
, intervals.end
, Summary.*
from query_111 intervals
left join lateral
(select
sum(case when (created < intervals.end) then 1 else 0 end) as active
sum(case when (closed > intervals.start) and (closed < intervals.end) then 1 else 0 end) as closed
from query_222
) Summary on true
Beta Was this translation helpful? Give feedback.
All reactions