Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

sum of columns when a certain value is true

veena panditAug 19 2011 — edited Aug 20 2011
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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 17 2011
Added on Aug 19 2011
19 comments
594 views