title: ISNULL with COUNT(*)
body: <pre><code>╔═══════╦═══════╗
  ║ agent ║ prime ║
  ╠═══════╬═══════╣
  ║ Said  ║ 100   ║
  ║ Farid ║ 200   ║
  ║ Walid ║ 150   ║
  ║ Said  ║ 300   ║
  ║ Said  ║ 250   ║
  ║ Said  ║ 400   ║
  ║ Farid ║ 300   ║
  ║ Farid ║ 250   ║
  ║ Walid ║ 140   ║
  ╚═══════╩═══════╝
  </code></pre>
  
  <p>Query</p>
  
  <pre><code>select  agent, ISNULL(count(*),0) as NB from [agents]
  where prime &gt;= 200
  group by agent
  </code></pre>
  
  <p>The output:</p>
  
  <pre><code>╔═══════╦═══════╗
  ║ agent ║ prime ║
  ╠═══════╬═══════╣
  ║ Farid ║     3 ║
  ║ Said  ║     3 ║
  ╚═══════╩═══════╝
  </code></pre>
  
  <p>I want to replace the null value with 0 because as you can see the agent 'walid' have no prime >= 200. The results I want to achieve:</p>
  
  <pre><code>agent   prime
  Farid   3
  Said    3
  Walid   0
  </code></pre>
  
  <p>I know Its achievable using a <code>UNION</code> but I want to know why this ISNULL is not functional in this case and If its possible to do.</p>