CASE
WHEN instr(tmp.减小时与不减, '.')= 0 THEN tmp.减小时与不减
WHEN substr(tmp.减小时与不减, instr(tmp.减小时与不减, '.')+ 1, 1)* 1 >= 5 THEN substr(tmp.减小时与不减, 1, instr(tmp.减小时与不减, '.')-1)+ 0.5
ELSE
substr(tmp.减小时与不减, 1 , instr(tmp.减小时与不减, '.')-1)+ 0
END AS 判断
case when instr(tmp.减小时与不减,'.')=0 then tmp.减小时与不减
when tmp.减小时与不减*1<0 then 0 /*如果为负数直接返回0小时吧*/
when substr(tmp.减小时与不减,instr(tmp.减小时与不减,'.')+1,1)*1>=5 then substr(tmp.减小时与不减,1,instr(tmp.减小时与不减,'.')-1)+0.5 else
substr(tmp.减小时与不减,1,instr(tmp.减小时与不减,'.')-1)+0 end as 判断
是不是有些tmp.减小时与不减 没得 “.” 哦
instr遇到0开头的小数会忽略0