I want to get a result like this, in a single list.
TYPE | subtype | Total
A | z | 5
A | y | 3
total A | NULL | 8
B | i | 6
total B | Null | 6
How can I do this in a sql stored procedure?
Edit: I work in T-Sql for Sql server
This will work for all kinds of SQL.
If you have a specific kind of SQL there may be a more efficient solution