参数日期控件填入具体日期 开始日期跟结束日期,根据这个日期求这个月的数据,sql怎么写 下面是我写当期的sql select (case when a.compname = '北京分公司' then '北京' when a.compname = '河南分公司' then '河南' when a.compname = '江苏分公司' then '江苏' when a.compname = '上海分公司' then '上海' end) as 销售区域, a.bankname as 销售渠道, c.shortname as 销售产品, (case when a.payintv = 0 then '趸交' when a.payintv <> 0 then a.payendyear end) as 缴费年期, count(distinct a.contno) 件数, sum(a.new_prem) AS TRANSMONEY, 'NB' as datatype from com_polno_detail a inner join tmp_performance b on a.contno = b.contno and b.deptname in ('股份行', '地方行') left join com_risk_mapping c on a.riskcode = c.riskcode where a.signdatep >= date '${startdate}' and a.signdatep <= date '${enddate}' group by a.compname, a.bankname, c.shortname, (case when a.payintv = 0 then '趸交' when a.payintv <> 0 then a.payendyear end) 报错了 |