this works for three columns but will get unwieldy for more than that.
create table tmp(
Status varchar(10) not null,
ColumnA float,
ColumnB float,
ColumnC float
)
insert into tmp (Status, ColumnA, ColumnB, ColumnC) values ('Closed', 10, 20, 5)
insert into tmp (Status, ColumnA, ColumnB, ColumnC) values ('Open', 15, 10, 10)
SELECT Status
, round(ColumnA * 100 / tot.a, 0) AS '% of total'
, round((ColumnA + ColumnB) * 100 / tot.b, 0) AS '% of total'
, round((ColumnA + ColumnB + ColumnC) * 100 / tot.c, 0) AS '% of total'
FROM tmp
CROSS JOIN (
SELECT SUM(ColumnA) AS a
, SUM(ColumnA + ColumnB) AS b
, SUM(ColumnA + ColumnB + ColumnC) AS c
FROM tmp) tot
drop table tmp
------------------------------
mark kertzner
------------------------------