sum of columns when a certain value is true
select state,
sum(case status when 'Y' then 1 else 0 end) as count_true,
sum(case status when 'N' then 1 else 0 end) as count_false,
sum(state) as total_states
from test_table
where date between ? and ?
group by state
why is this not working. I am using it in birt. It does not give me any errors but it doesn't compute the values.