like put the condition in the filtering condition?
# general
j
like put the condition in the filtering condition?
w
yeah, we can do that, but that will result an extra query, and I would need to join the result back manually
actually, @James Shao do you know if we can define null as the default value for a string value column, would this make
count(column_name)
to be the count of non-empty values?
j
I don't recall null is supported, but how about you define that as empty string and put a filtering condition in the where condition?
w
that works, but I wanted to get multiple aggregated results together within a single query, something like
Copy code
select count(foo), sum(bar), sum(case baz = '' then 0 else 1 end) from tablex where ...
but put
baz != ''
in the where clause will affect other aggregated values