摘要: 关于一个统计的算法问题:T 表结构如下:A B C D1 2 3 14 5 6 11 2 2 12 1 2 2 1 2 3 2 1 1 1 2需求:按D 分组统计 A=1,B=2,C=1 and B=2的个数!下面是按照自己的算法统计出来的如图--下面创建测试脚本create table t(A int,B int ,C int ,D int)---测试数据while(1=1)begininsert into tselect * from (select convert(int,rand()*1000) a , convert(int,rand()*1000) b, convert(int,r 阅读全文