0 - 2 of 2 tags for case when multiple columns



I have a following query with multiple case when statements and i would need to performance tune it.


Request your help in re-writing this code.



Case when (Table1.col2=Table2.col2) then Table1.Qty else Null end as AndJoinQty1

I have the following CASE WHEN statement in my query and would like to get a count of each "category", so output would look something like this: