SELECT GLWR01,sum(glaa/100) FROM proddta.f0911,proddta.f0010 where glco=ccco and GLCTRY = '${GLCTRY}' --世纪 and GLFY = '${GLFY}' --年份 and GLPN = '${GLPN}' --月份 and CCNAME = '${CCNAME}' --公司名称 ${if(len(GLPOST)==0,"",if(GLPOST="P","and GLPOST='P'","and GLPOST is null"))} group by GLWR01 这是我查询当月金额的SQL 求问如何写一个 比如我月份选3 查出的金额 就是 1月+2月+3月的金额 选几月就累加到几月 |