试一试:
TRANSFORM Sum(总分之计数) AS 总分之计数之总计
SELECT 分数段显示
FROM (SELECT 查询1.班别, 查询1.分数段显示, Count(查询1.总分) AS 总分之计数
FROM 查询1
GROUP BY 查询1.班别, 查询1.分数段显示
UNION SELECT '合计' AS 合计, 查询1.分数段显示, Count(查询1.总分) AS 总分之计数
FROM 查询1
GROUP BY '合计', 查询1.分数段显示
UNION SELECT 查询1.班别, "合计" as jj, Count(查询1.总分) AS 总分之计数
FROM 查询1
GROUP BY 查询1.班别, "合计")
GROUP BY 分数段显示
PIVOT 班别;
TRANSFORM Sum([%$##@_Alias].总分之计数) AS 总分之计数之总计
SELECT [%$##@_Alias].分数段显示
FROM [SELECT 查询1.班别, 查询1.分数段显示, Count(查询1.总分) AS 总分之计数
FROM 查询1
GROUP BY 查询1.班别, 查询1.分数段显示
UNION SELECT '合计' AS 合计, 查询1.分数段显示, Count(查询1.总分) AS 总分之计数
FROM 查询1
GROUP BY '合计', 查询1.分数段显示
UNION SELECT 查询1.班别, "合计" as jj, Count(查询1.总分) AS 总分之计数
FROM 查询1
GROUP BY 查询1.班别, "合计"]. AS [%$##@_Alias]
GROUP BY [%$##@_Alias].分数段显示
PIVOT [%$##@_Alias].班别;
TRANSFORM Sum(查询1.班别之计数) AS 总计
SELECT 查询1.分数段显示, Sum(查询1.班别之计数) AS 总合计
FROM [SELECT 查询1.班别, 查询1.分数段显示, Count(查询1.班别) AS 班别之计数
FROM 查询1
GROUP BY 查询1.班别, 查询1.分数段显示
UNION SELECT 查询1.班别,'合计' ,count(查询1.班别) as 计数
from 查询1
GROUP BY 查询1.班别]. AS 查询1
GROUP BY 查询1.分数段显示
PIVOT 查询1.班别;