|
楼主 |
发表于 2009-4-22 14:03
|
显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
SELECT DISTINCT a.type, a.date, a.result, a.resultofcount, b.resultofsum, a.resultofcount/b.resultofsum AS 占百分比
FROM [SELECT table1.result,table1.type,table1.date, Count(table1.result) AS resultofcount FROM table1 GROUP BY table1.result, table1.date,table1.type]. AS a LEFT JOIN [SELECT table1.date,table1.type,Count(table1.result) AS resultofsum FROM table1 GROUP BY table1.date,table1.type]. AS b ON a.date = b.date
WHERE (((a.type)=[which type]) AND ((a.date) Between [beginning date] And [ending date]) AND ((a.result)=[which result]));
是执行这个SQL后的结果 |
|