title: Grouping based on pattern Sql
body: <p>Say I have the following table name <strong>t1(deptName,courseName,fund)</strong> I want to get sum of fund of each courseName with its deptName.So far all  I can do is group by courseName and sum(fund) to get sum of fund under each courseName but how can I also include deptName on each output row like deptName,CourseName sum(fund)?
  Thanks in advance.</p>