首页 >数据库 >mysql教程 >Sql Server统计表中某年某月某个值有多少?

Sql Server统计表中某年某月某个值有多少?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB原创
2016-06-07 14:54:051369浏览

比如:统计表AA中YWLX列在某年某月每种类型各有多少? select year(AA_YWRQ) as YEARS, month(AA_YWRQ) AS Months ,AA_YWLX,count(AA_YWLX) as Number from AA group by year(AA_YWRQ), month(AA_YWRQ),AA_YWLX 表中数据: 查询后的结果:

  比如:统计表AA中YWLX列在某年某月每种类型各有多少?

  select

  year(AA_YWRQ) as YEARS,

  month(AA_YWRQ) AS Months ,AA_YWLX,count(AA_YWLX) as Number

  from AA

  group by year(AA_YWRQ),

  month(AA_YWRQ),AA_YWLX

  表中数据:

Sql Server统计表中某年某月某个值有多少? 三联

  查询后的结果:

Sql Server统计表中某年某月某个值有多少?

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
上一篇:PS通道抠图实例下一篇:Oracle杂记