Aggregating on a repeated group
This kind of problem can be solved with the use of the LAG() function:

WITH cte AS
  ( SELECT dept,
           term,
           LAG(dept) OVER (ORDER BY term) AS prev_dept
     FROM tableX
  )
SELECT dept, term
FROM cte
WHERE prev_dept &lt;&gt; dept 
   OR prev_dept IS NULL
ORDER BY term ;


Test at: SQL-Fiddle