1.,concat(round(cast(finish_rate as decimal)*100,4),'%') `累计完成率` ------注意转化格式
,concat(substr(finish_rate*100,1,4),'%') `累计完成率`
VERTICA 格式转化
,(case when t1_outtype=3 and to_date(t1_ros_outdate)<=COALESCE(to_date(t1_realbegindate),to_date(t1_dtbegindate),'3000-12-31') then 1 else 0 end ) -- 开课前退班
,(case when t1_outtype=3 and to_date(t1_ros_outdate)>COALESCE(to_date(t1_realbegindate),to_date(t1_dtbegindate),'3000-12-31') then 1 else 0 end ) -- 开课后退班
日期拼接
select
case
when ros_outtime<>'' then concat(concat(to_char(ros_outdate,'yyyy-MM-dd'),' '), substr(ros_outtime, 0, 9))
else to_char(ros_outdate,'yyyy-MM-dd HH24:mi:ss') end
from roster
'FY'||substr(to_char(cl.classbelong_start_fyear),3)||(case when cl.classbelong_start_quarterdtl=10 then '暑假'
when cl.classbelong_start_quarterdtl=20 then '秋季'
when cl.classbelong_start_quarterdtl=21 then '秋上'
when cl.classbelong_start_quarterdtl=22 then '秋下'
when cl.classbelong_start_quarterdtl=30 then '寒假'
when cl.classbelong_start_quarterdtl=40 then '春季'
when cl.classbelong_start_quarterdtl=41 then '春上'
when cl.classbelong_start_quarterdtl=42 then '春下'
else '不区分' end) as 班级归属季度,