Where clause doesn’t work with aggregate without group by Clickhouse
I’m trying to count sum and count without group by with three different conditions and add written flag to distinguish them from each other. Then I’m trying to get the only one record with certain flag. But the result query from cte doesn’t filter as I expect. It works the same as if I add filter by flag_purchase to where clause in cte.
Where clause doesn’t work with aggregate without group by Clichouse
I’m trying to count sum and count without group by with three different conditions and add written flag to distinguish them from each other. Then I’m trying to get the only one record with certain flag. But the result query from cte doesn’t filter as I expect. It works the same as if I add filter by flag_purchase to where clause in cte.