Author: chandan.inst
Subject: Reply to: Require help in DB2 Query
Posted: Tue Aug 09, 2016 11:20 am (GMT 5.5)
is this something you are expecting?
Thanks,
Chandan
Subject: Reply to: Require help in DB2 Query
Posted: Tue Aug 09, 2016 11:20 am (GMT 5.5)
is this something you are expecting?
Code: |
select Count(case when (t1.a = 1 and t1.b<> 2) then 1 else 0 end) as A_COUNT , Count(case when (t1.b = 2 and t1.a<>1) then 1 else 0 end) as B_COUNT from t1 |
Thanks,
Chandan