title: PostgreSQL: Counting Distinct Across Multiple Columns (Alongside Other Selections)
body: <p>A simple SQL statement in PostgreSQL:</p>
  
  <pre><code>select class_offerings.semester_code as SC, class_offerings.class_code as CC,
  class_offerings.class_name as CN, class_offerings.teacher_name as TN, 
  count(distinct class_enrollment.semester_code, 
  class_enrollment.class_code) as num_enrolled, --wrong
  class_enrollment.maximum_capacity as max_enrollment 
  from class_offerings natural join class_enrollment;
  </code></pre>
  
  <p>PostgreSQL doesn't support this syntax. What should I do instead? Expected result:</p>
  
  <pre><code>SC | CC | CN | TN | num_enrolled | max_enrollment
  </code></pre>