test.sql 222 B

123456
  1. -- run this to use test: db2 -tvmf test.sql
  2. with eachclass (sectioncount) as
  3. (select count(*) from class
  4. where term = 1185
  5. group by (deptcode, cnum))
  6. select count(*), sectioncount from eachclass group by sectioncount;