case when Substr(param["统计日期1”],6,5)='01-01'
and Substr(param["统计日期2”],6,5)-'12-31'
and Substr(param["统计日期1"],1,4)- Substr(param["统计日期2“],1,4)
Case
when col['stat_date']
end
BETWEEN add_months (param["统计日期1”],-12)and add_months(param["统计日期2”],-12)then col['policy_qty']
when Substr(param["统计日期1"],9,2)-'01'
and Substr(param["统计日期2“],9,2)=
substr(cast (LAST_day (param["统计日期2"]) asstring),9,2)
case
when cast(substr(param["统计日期2"],6,2) as int)-cast(substr(param["统计日期1"1,6,2) as int)>0
then
Case
when col['stat_date'] BETWEEN
add_months (param["统计日期1"1,-1*(cast(substr(param["统计日期2"1,6,2) as int)-cast(substr(param["统计日期1"],6,2) as int)+
)) and
add months(param["统计日期2"1,1*(oast(substr(param["统计日期2"],6,2) as int)-cast(substr(param[“绕计日期1"],6,2) as int)+
end
then col['policy_qty']
when cast(substr(param["统计日期2"1,6,2) as int)-cast(substr(param["统计日期1"1,6,2) as int)<o
then
Case
when col['stat_date ] BETWEEN
+127) and
add_months (param["统计日期1”],1*(cast(substr(param["统计日期2"],5,2) as int)-cast(substr(param["统计日期1”1,6,2) as int)add_ months (param["统计日期2"1,-1*(cast(substr(param["统计日期2"1,6,2) as int)-cast(substr(param["统计日期1"],6,2) as int)+12))
then col['policy_qty']
end
end
else null
end |