title: Count based on number of times a record is associated with another column
body: <p>Trying to get a count on a table but not the total number of times a specific record appears, but the number of times it was associated with records in another field. </p>
  
  <p>For example, in the below I want to count the number of times each elem record was associated with a unique widget record.</p>
  
  <pre>
         WIDGET_ELEM_INSP
  ╔════════╦════════╦══════╗
  ║ Widget ║  Insp  ║ Elem ║
  ╠════════╬════════╬══════╣
  ║   121  ║ abc    ║  12  ║
  ║   121  ║ tkx    ║  12  ║
  ║   121  ║ cvb    ║  13  ║
  ║   328  ║ efl    ║  13  ║
  ║   328  ║ rrb    ║  12  ║
  ║   328  ║ plw    ║  12  ║
  ║   328  ║ nrs    ║  12  ║
  ║   328  ║ itx    ║  10  ║
  ║   489  ║ zmy    ║  10  ║
  ║   489  ║ lwv    ║  13  ║
  ╚════════╩════════╩══════╝
        Desired Output
  ╔══════╦═══════════╗
  ║ Elem ║   Count   ║
  ╠══════╬═══════════╣
  ║ 10   ║     2     ║          
  ║ 12   ║     2     ║          
  ║ 13   ║     3     ║          
  ╚══════╩═══════════╝
  </pre>
  
  <p>Doing the below gives me the total number of times each elem record show up.</p>
  
  <p><pre><code>SELECT ELEM, COUNT(*) AS [Total Element Instances]
  FROM WIDGET_ELEM_INSP
  GROUP BY ELEM
  ORDER BY ELEM; 
  </pre></code></p>
  
  <p>And this gives me a listing of each elem and widget combo I need </p>
  
  <p><pre><code>SELECT ELEM, WIDGET
  FROM WIDGET_ELEM_INSP
  GROUP BY ELEM, WIDGET
  ORDER BY ELEM;</pre></code></p>
  
  <p>The problem is I can't get them combined to show what I want. Feel like I am overlooking the obvious and any help would be greatly appreciated. </p>