title: Counting Distinct Columns Based on Count of third column
body: <p>My query: </p>
  
  <pre><code>SELECT DISTINCT job_id, cust_id, a.skill_id FROM aaa.jp_job_skill_ref a INNER JOIN aaa.jp_cust_skill_ref b ON a.skill_id = b.skill_id ORDER BY `job_id`, `cust_id`, `skill_id`;
  </code></pre>
  
  <p>Returns 3 columns of data. However, both tables are reference tables with hundreds of the same cust_id and skill_id, or job_id and skill_id, so a count(a.skill_id) with a group by job_id and cust_id returns a skill_id count of 30+</p>
  
  <pre><code> job_id, cust_id, skill_id
       2,       1,        1
       2,       1,        2
       2,       1,        9
       2,       3,        1
       2,       3,        2
       2,       3,        9
       2,       3,       10
       2,       4,        1
       2,       4,        9
       3,       1,       12
       3,       3,       10
       3,       4,       12
  </code></pre>
  
  <p>What I would LIKE it to return is The Job ID, the Cust Id, and the count of different Skill_ID's. What am I missing to return the following dataset:?</p>
  
  <pre><code>job_id, cust_id, skill_id
  '2',   '1',     '3'
  '2',   '3',     '4'
  '2',   '4',     '2'
  '3',   '1',     '1'
  '3',   '3',     '1'
  '3',   '4',     '1'
  </code></pre>