title: ISNULL or any alternative in sql server when not data present for subquery
body: <p>I have a situation, Where I need to get some data in case I find no data for certain query. e.g. </p>
  
  <pre><code>select id from abc where userid='XYZ'
  </code></pre>
  
  <p>In this case I will get the Id, only if the record with userid='XYZ' is present in the table abc. </p>
  
  <p>Below given code will give 123 only if id is present as null .This is not what I'm expecting.</p>
  
  <pre><code>select isnull(id,123) from abc where userid='XYZ'
  </code></pre>
  
  <p>I want something like:<br><em>If no data in abc with userid='XYZ', then some specific value should be output.</em> <br>e.g.</p>
  
  <pre><code>select isnull((select id from abc where userid='XYZ'),123)
  </code></pre>
  
  <p>Is there any similar shortcut for the above query?? Please suggest. Thanks in advance</p>