title: SQL - How to convert a varchar into int with case
body: <p>I have a table like this</p>
  
  <pre><code>productId Inventory 
  --------------------    
  1            1
  2            Ab
  3            12.5
  4            6
  6            2
  </code></pre>
  
  <p>How to select inventory as <code>int</code> and other value is zero, where <code>Inventory</code> is <code>varchar</code>?</p>