Você pode fazer isso facilmente com um
UNION ALL . A chave é que master_code campo deve ser do mesmo tipo de dados que a string total então você terá que convertê-lo:select cast(master_code as varchar(10)) master_code, jan
from yourtable
union all
select 'Total', sum(jan)
from yourtable
Consulte SQL Fiddle with Demo
Ou você pode usar
GROUP BY with ROLLUP :select
case
when master_code is not null
then cast(master_code as varchar(10)) else 'total' end master_code,
sum(jan) Jan
from yourtable
group by master_code with rollup
Consulte SQL Fiddle with Demo