title: How can use 'AS' syntax?
body: <p>I need to different data in different table I am trying use AS 
  I try all code all of them work but one by one , ı am not working together
  I try two ways but ıts nor working  ı thought roung syntax ı resarch but ı am new in sql</p>
  
  <p>My first way: </p>
  
  <pre><code>            string cmd = @" SELECT COUNT(Ref) AS data,"; 
          cmd += @" (select count(CustomerID) as data2 from Contract where DATEDIFF(DAY,StartDate,GETDATE()) between 0 and 30),";
          cmd += @" (select count(distinct(CustomerID)) as data3 from Contract where FinishDate &gt; GETDATE()),";
          cmd += @" (select count(Ref) as data4 from Support where DATEDIFF(DAY,StartDate,GETDATE()) between 0 and 30)";
          cmd += @" FROM Customer WHERE (Deleted = 0 or Deleted is null) ";
  </code></pre>
  
  <p>My second way: </p>
  
  <pre><code>    string cmd = @" SELECT COUNT(Ref) ,"; 
          cmd += @" (select count(CustomerID) from Contract where DATEDIFF(DAY,StartDate,GETDATE()) between 0 and 30) as data2 ,";
          cmd += @" (select count(distinct(CustomerID))  from Contract where FinishDate &gt; GETDATE()) as data3,";
          cmd += @" (select count(Ref)  from Support where DATEDIFF(DAY,StartDate,GETDATE()) between 0 and 30) as data4";
          cmd += @" FROM Customer WHERE (Deleted = 0 or Deleted is null) AS data ";
  </code></pre>