标签:
select mcorhr,dtype,
sum(h01) as sums,
datepart(year,(select left(mdate,4)+‘-‘+substring(mdate,5,2)+‘-‘+right(mdate,2))) as y,
datepart(month,(select left(mdate,4)+‘-‘+substring(mdate,5,2)+‘-‘+right(mdate,2))) as m
from "EMSHIS"."CBPM"."CBPM_LINE_LIMIT"
where 0=0
group by mdate,mcorhr,dtype
标签:
原文地址:http://www.cnblogs.com/lengzhijun/p/5658499.html