select name,v1 from( select 'Avg' as name,AVG(V1) as v1 from temp union select name,v1 from temp) as ss
SELECT 'AVERAGE',AVG(V1),AVG(V2),AVG(V3) FROM TABLENAME UNION SELECT NAME,V1,V2,V3 FROM TABLENAME ORDER BY 1
select name, avg(v1),avg(v2),avg(v3) from yourtable group by name with rollup
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)