title: Need to count distinct values with a composite primary key
body: <p>I have to generate a report that displays the name of different locations and the number of times unique course offerings are offered in these locations. The report needs to only indicate the city and the no. of unique course offerings and be sorted by the highest number of unique offerings.
  The problem I have is the offering table has a composite primary key (offering begin date and course code)</p>
  
  <p>I run this SQL query and it comes up with an error as you can't count multiple columns. But I am not sure how to split the count.</p>
  
  <pre><code>SELECT 
      offlocation AS city, COUNT(distinct offbegindate,crscode) as no. of unique course offerings
  FROM
      offering
  GROUP BY offlocation
  ORDER BY COUNT(distinct offbegindate,crscode) as no. of unique course offerings DESC;
  </code></pre>
  
  <p>Any help will be greatly appreciated.</p>