查询某字段的当前月的前36个月之和
字段名:month_date,
数据库表名:dc_market_vol_city_f,
怎么写?
select sum(字段) from dc_market_vol_city_f where CONVERT(varchar(7),month_date,120)>=CONVERT(varchar(7),DATEADD(month,-36, getdate()), 120)
select * from dc_market_vol_city_f where datediff(month,month_date,getdate())<=36
不先说数据库啥类型问脚本的都是耍流氓