Is there any possibility to use something linke having() within a min() aggregate inline?
select distinct
"timestamp"
, MinActiveValue = min( "value" ) over ( partition by "timestamp" ) having ( "active" = 1 )
from
"data"
In the linked example below, things work well using the first query.
Indeed, i don’t want to have to use the where clause for min-condition, since i would destroy data-filtering used in the same query. ( there are some grouped sums calculated by the same query for example )
Perhaps this:
Here you can apply your filter in the CTE itself.
Demo