时不时还会提示错误
所以只好用图片作者: tmtony 时间: 2017-6-17 11:02
周义坤回复的
select format(DateSerial(year(a.月份), Month(a.月份), 1),'yyyy-m月') as 日期,
max(a.能耗)-(select max(b.能耗) from 表1 as b where DateSerial(year(a.月份), Month(a.月份), 1)=DateSerial(year(b.月份), 1+Month(b.月份), 1)) as 结果
from 表1 as a
where format(a.月份,'yyyy-m')<>(select format(min(月份),'yyyy-m') from 表1) group by DateSerial(year(a.月份), Month(a.月份), 1)作者: 周义坤 时间: 2017-6-17 11:05
试下是不是只能上传图表! 作者: ui 时间: 2017-6-17 11:44
select format(DateSerial(year(a.月份), Month(a.月份), 1),'yyyy-m月') as 日期,
max(a.能耗)-(select max(b.能耗) from 表1 as b where DateSerial(year(a.月份), Month(a.月份), 1)=DateSerial(year(b.月份), 1+Month(b.月份), 1)) as 结果
from 表1 as a
where format(a.月份,'yyyy-m')<>(select format(min(月份),'yyyy-m') from 表1) group by DateSerial(year(a.月份), Month(a.月份), 1)