title: How can you use COUNT() in a comparison in a SELECT CASE clause in Sql Server?
body: <p>Let's say you want do something along the following lines:</p>
  
  <pre><code>SELECT CASE 
      WHEN (SELECT COUNT(id) FROM table WHERE column2 = 4) &gt; 0
      THEN 1 ELSE 0 END
  </code></pre>
  
  <p>Basically just return 1 when there's one or more rows in the table, 0 otherwise.  There has to be a grammatically correct way to do this.  What might it be?  Thanks!</p>