title: SQL server return only single row or null
body: <p>I have a SQL query which I only ever want to return 1 row. If there are multiple rows, I want to return null.</p>
  
  <p>I guess I can do it with something like</p>
  
  <pre><code>SELECT whatever FROM MyTable
   WHERE something = myQuery
     AND ( COUNT(SELECT whatever FROM MyTable
               WHERE something = myQuery) = 1)
  </code></pre>
  
  <p>but that's pretty nasty and I wondered if there as a neater way of doing it.</p>