title: SQL select return 0 if no records found, else return value
body: <p>I am now using Microsoft SQL, my code is:</p>
  
  <pre><code>   SELECT TOP 1 
     [avail]
     FROM [table1]
     where [name] = 'abc'
     order by [datetime] desc
  </code></pre>
  
  <p>I hope when [avail] exists, return the value of [avail], if not exists, return 0 or "Not Found"</p>
  
  <p>Thanks!</p>