title: Different record count values in one query
body: <p>My goal is to achieve a result set like the following</p>
  
  <pre><code>CODE | TOTAL1 | TOTAL2  
  1    | 56     | 34  
  2    | 12     | 15  
  3    | 90     | 3
  </code></pre>
  
  <p>There are 2 tables e.g tableA and tableB<br>
  The counts are different by tableB.type</p>
  
  <pre><code>SELECT   code, COUNT (*) AS total1  
  FROM tableA a
  WHERE a.ID IN (select ID from tableB
      where type = 'XYZ')
  GROUP BY code
  
  
  SELECT   code, COUNT (*) AS total2  
  FROM tableA a
  WHERE a.ID IN (select ID from tableB
      where type = 'ABC')
  GROUP BY code
  </code></pre>
  
  <p>I'd like to display the count for each code per type in the same query</p>
  
  <p>Thanks in advance</p>