当前位置: 代码迷 >> Sql Server >> 求一sql语句,请问sql达人
  详细解决方案

求一sql语句,请问sql达人

热度:89   发布时间:2016-04-27 11:15:10.0
求一sql语句,请教sql达人
数据库 表单格式

datetime register(注册人数)
2012-07-25 1
2012-07-26 2
2012-08-01 2
2012-08-12 4

sql语句如何实现统计7月份、8月份注册人数。 在不考虑datatable的程序实现的前提下。谢谢。。

------解决方案--------------------
SQL code
select year(datetime) as '年',month(datetime) as '月',sum(register) as 总人数from TBgroup by  year(datetime),month(datetime)
  相关解决方案