Home > Database > Mysql Tutorial > Sql Server统计表中某年某月某个值有多少?

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

WBOY
Release: 2016-06-07 14:54:05
Original
1346 people have browsed it

比如:统计表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统计表中某年某月某个值有多少?

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template