Count on case Oracle
<p>WE have below data in oracle database - </p>

<pre><code>col1 col2 
Z1     A
Z1     B
Z2     A
Z2     C
Z3     A   
Z4     D
</code></pre>

<p>I want count on column two in such a way that - </p>

<p>Ouput - </p>

<pre><code>col2  count
A      3     (Z1,Z2,Z3)
B      0     (Dont count if A is already present for record)
C      0
D      1      (Z4)
</code></pre>

<p>Best Regards</p>