请教个问题 这个SQL如何实现
一个表A有一列COL1为整数
例如A(COL1,COL2,COL3)
现在我要做一个查询,根据COL1的大小进行统计
例如
我要进行的查询为
Select x,y,z,N1,N2,N3....From TA1,A,B
select sum(case when col1 <=100 then 1 else 0 end) as [0--100],sum(case when col1 between 101 and 1000 tnen 1 else 0 end) as [101--1000],.....from tbl