Hi. Is there a way to apply partial case statement...
# general
s
Hi. Is there a way to apply partial case statement ? Use case : case when followed by else scans all the documents whereas the same condition when applied in where doesn't do full scan.
Copy code
sum(case when column_a = 1 then 1 else 0 end)
vs
Copy code
count(*) where column_a = 1
Follow-up : Is there a way to apply coalesce ?
m
I think I'm missing something...why can't you do:
Copy code
select sum(column_a)
from ...
k
you can use filter with aggregation
@Atri Sharma do we have any docs for this?
a
I do remember adding, yes
k
can you point us to that..