title: SQL Server Multiple Counts in the same Query - CosmosDB
body: <p>I want to create a query counting the total number of liks and dislikes within a collection of documents described below.</p>
  <pre><code>{
      &quot;id&quot;: &quot;403031b7-a1b6-4e08-9d82-360bb41b97cd&quot;,
      &quot;car_id&quot;: &quot;0839404d5bc4140f28abfd19329b0ebc&quot;,
      &quot;created&quot;: 1621881785,
      &quot;type&quot;: &quot;like&quot;,
      &quot;version&quot;: 1,
      &quot;fingerprint&quot;: &quot;kHqPGWS1Mj18sZFsP8Wl&quot;,
  }
  
  {
      &quot;id&quot;: &quot;403031b7-a1b6-4e08-9d82-360bb41b97cd&quot;,
      &quot;car_id&quot;: &quot;0839404d5bc4140f28abfd19329b0ebc&quot;,
      &quot;created&quot;: 1621881785,
      &quot;type&quot;: &quot;unlike&quot;,
      &quot;version&quot;: 1,
      &quot;fingerprint&quot;: &quot;kHqPGWS1Mj18sZFsP8Wl&quot;,
  }
  </code></pre>
  <hr />
  <p>The following works perfect for one count:</p>
  <pre><code>SELECT COUNT(1) AS likes from cars c WHERE c.type=&quot;like&quot; and c.car_id=&quot;0839404d5bc4140f28abfd19329b0ebc&quot;
  </code></pre>
  <p>But I want to count booth likes and unlikes where c.type is &quot;like&quot; and c.type=&quot;unlike&quot; in the same query.</p>
  <hr />
  <p>Resulting in something like this:</p>
  <pre><code>{
      &quot;likes&quot;: a,
      &quot;unlikes&quot;: b
  }
  </code></pre>