title: Get the number of rows per tenant of several tables
body: <p>Let's say I have 2 tables: <code>Tenants</code> and <code>Wargles</code>. <code>Wargles</code> has a Foreign Key towards <code>Tenants</code> called <code>TenantId</code>. If I want to get number of wargles per tenant, I can do this:</p>
  
  <pre><code>SELECT t.Id as TenantId, count(w.Id) as WargleCount
  FROM Tenants t
  JOIN Wargles w ON w.TenantId = t.Id
  GROUP BY t.Id
  </code></pre>
  
  <p>Now, let's say I have another table, <code>Fiddles</code>, that, as <code>Wargles</code> has a FK towards <code>Tenants</code>. How can I add another column to the query above, so I get the number of wargles and the number of fiddles for each tenant?</p>
  
  <p>I tried with this:</p>
  
  <pre><code>SELECT t.Id as TenantId, count(w.Id) as WargleCount, count(f.Id) as FiddleCount
  FROM Tenants t
  JOIN Wargles w ON w.TenantId = t.Id
  JOIN Fiddles f ON f.TenantId = t.Id
  GROUP BY t.Id
  </code></pre>
  
  <p>But this won't work, since it would give me the same number both for WargleCount and FiddleCount, the product of the rows from both tables.</p>