如何查询每年1月的数据总和 请问如何查询每年1月的数据总和,就是说条件只是月份是否为1月,年份是可以任何年的?where后面应该怎么写?select sum(id)from table_1where ????????? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select sum(id)from table_1where month(datecolumn)='1' select convert(varchar(7),时间字段,120) as 年月, sum(id) as id from table_1group by convert(varchar(7),时间字段,120)where month(时间字段) = 1 select convert(varchar(7),时间字段,120) as 年月, sum(id) as id from table_1where month(时间字段) = 1group by convert(varchar(7),时间字段,120) select Convert(Char(7),时间,120) as Mon,sum(id) as sIDfrom table_1where Month(时间)=1 group by Convert(Char(7),时间,120) select sum(id) from table_1where month(时间字段) = 1group by convert(varchar(7),时间字段,120) 这里怎么改 sql server 2005 windows身份验证的问题,谢谢 请问这个问题怎么解决? 问这个SQL语句如何写?谢谢 sql server 中如何给text型变量赋值 求助:知道表的objectID,如何能获取这个表的主键的列名 高手请进: 如何读取每条记录的内部timestamp? 用osql执行脚本出错? 一个存储过程的问题,关于case语句的,头晕… (jadesun) 高手请进: bcp 问题 - 导出上次运行BCP之后更新的数据? 这个语句的问题和含义在那里呢? 查询结果付值给变量的问题。
from table_1
where month(datecolumn)='1'
from table_1
group by convert(varchar(7),时间字段,120)
where month(时间字段) = 1
from table_1
where month(时间字段) = 1
group by convert(varchar(7),时间字段,120)
from table_1
where Month(时间)=1 group by Convert(Char(7),时间,120)
from table_1
where month(时间字段) = 1
group by convert(varchar(7),时间字段,120)