title: Performance tune tSQL Query count(*) & subqueries
body: <p>I know that there's a better way to do what I'm trying to accomplish here.  Though the query works I fear it's performance will suffer as the dataset's it is applied to grow. </p>
  
  <p>I don't even necesarily need someone to rewrite what I have if they would just be willing to point me in the direction of the topic I should study I would greatly appreciate it. </p>
  
  <p>What I'm trying to return with this query is a count of the number of records at or above a certain status.  </p>
  
  <p>Thanks in advance for your help! </p>
  
  <p><code>SELECT
         ( SELECT  count(*)
           FROM TABLE1 c1 
           WHERE (  c1.U_KEY3 NOT LIKE 'z%' AND (c1.U_KEY1 = '' or c1.U_KEY1 IS NULL)  )
         ) AS 'STATUS is EMPTY'
      ,
         ( SELECT  count(*)
           FROM TABLE1 c1 
           WHERE ( c1.U_KEY3 NOT LIKE 'z%' AND LEFT(c1.U_KEY1,2) &gt;= '70' )
         ) AS 'STATUS &gt; 70'
      , 
         ( SELECT  count(*)
           FROM TABLE1 c1 
           WHERE ( c1.U_KEY3 NOT LIKE 'z%'  AND LEFT(c1.U_KEY1,2) &gt;= '50' )
         ) AS 'STATUS &gt; 50'
      , 
         ( SELECT  count(*)
           FROM TABLE1 c1 
           WHERE ( c1.U_KEY3 NOT LIKE 'z%' AND LEFT(c1.U_KEY1,2) &gt;= '30' )
         ) AS 'STATUS &gt; 30'
      , 
            ( SELECT  count(*)
           FROM TABLE1 c1 
           WHERE ( c1.U_KEY3 NOT LIKE 'z%' AND LEFT(c1.U_KEY1,2) &gt;= '10' )
         ) AS 'STATUS &gt; 10'</code></p>