Here is simple example, may be this will help you.
select institue.* from
(
select course_name
, Sum([Week0]) as [Week Start - 20 Aug 10]
, Sum([Week1]) as [Week Start - 27 Aug 10]
, Sum([Week2]) as [Week Start - 03 Sep 10]
from course group by course_name
) institue
union all
select 'total' as course_name,
, Sum([Week0]) as [Week Start - 20 Aug 10]
, Sum([Week1]) as [Week Start - 27 Aug 10]
, Sum([Week2]) as [Week Start - 03 Sep 10]
from course
description :
--> In first query you need to bring your data with the use of
SUM
for weeks and make course name in
GROUP BY
.
--> In second query you need to user
UNION ALL
and type your query to fetch only one record for only SUM of above all.
--> You need to modify above query with your table structure.