SELECT 输入计算数据.桩号, 输入计算数据.数量, 输入计算数据.直径, 输入计算数据.[砼桩长(m)], [数量]*3.14*[直径]^2/4*[砼桩长(m)] AS 砼工程量, "砼" AS 分类
FROM 输入计算数据
UNION ALL SELECT 输入计算数据.桩号, 输入计算数据.数量, 输入计算数据.直径, 输入计算数据.[土方桩长(m)], [数量]*3.14*[直径]^2/4*[土方桩长(m)] AS 土方工程量, "土方" AS 分类
FROM 输入计算数据
ORDER BY 输入计算数据.桩号, 分类;
SELECT "砼" AS 分类, 输入计算数据.桩号,输入计算数据.数量, 输入计算数据.直径, 输入计算数据.[砼桩长(m)], [数量]*3.14*[直径]^2/4*[砼桩长(m)] AS 砼工程量
FROM 输入计算数据
UNION ALL SELECT "土方" AS 分类,输入计算数据.桩号, 输入计算数据.数量, 输入计算数据.直径, 输入计算数据.[土方桩长(m)], [数量]*3.14*[直径]^2/4*[土方桩长(m)] AS 土方工程量
FROM 输入计算数据
union all SELECT "总计" as 总计,"","砼工程量" as 砼工程量,Sum([输入计算数据 查询].砼工程量) AS 砼工程量之Sum, "土方工程量" as 土方工程量,Sum([输入计算数据 查询].土方工程量) AS 土方工程量之Sum
FROM [输入计算数据 查询]
ORDER BY 输入计算数据.桩号, 分类;