title: SQL Query using In and Not In clause on the same column
body: <pre><code>Product Name    Product Id  Product Status
  A               1           Rollout
  A               1           Storage
  A               1           Delivered
  A               5           Storage
  B               2           Rollout
  C               3           Rollout
  A               4           Rollout
  A               5           Rollout
  B               6           Rollout
  C               7           Rollout
  </code></pre>
  
  <p>In the above table I want to write below query which should return the result like</p>
  
  <pre><code>Product Name QOH
  A            1
  B            0
  C            0
  </code></pre>
  
  <p>Query: </p>
  
  <pre><code>SELECT Product Name, Count(Product Id) 
  FROM table_t1 
  WHERE Product Status IN ('Storage') AND Product Status NOT IN ('Delivered')
  </code></pre>
  
  <p>But the above query returns following result</p>
  
  <pre><code>Product Name QOH
  A            2
  B            0
  C            0
  </code></pre>
  
  <p>Please help.</p>