x亿xxxx万xxxx
case
when LENGTH(t.cnt)>8 then CONCAT(left(t.cnt,length(t.cnt)-8),"亿",substr(right(t.cnt,8),1,4),"万",right(t.cnt,4))
when LENGTH(t.cnt)>4 then CONCAT(left(t.cnt,length(t.cnt)-4),"万",RIGHT(t.cnt,4))
else t.cnt
end convertnum
x亿xxxx万xxxx.xx
select concat(o.convertnum,o.cc) from( select case when LENGTH(t.cnt)>8 then CONCAT(left(t.cnt,length(t.cnt)-8),"亿",substr(right(t.cnt,8),1,4),"万",right(t.cnt,4)) when LENGTH(t.cnt)>4 then CONCAT(left(t.cnt,length(t.cnt)-4),"万",RIGHT(t.cnt,4)) else t.cnt end convertnum, cc from( select POSITION("."in r.num) as aa, left(r.num,POSITION("."in r.num)-1) as cnt, substr(r.num,POSITION("."in r.num)) as cc from (select "12345678900.56" as num) r )t ) o
标签:cnt,right,xxxx,xx,num,数据格式,CONCAT,left From: https://www.cnblogs.com/zhjvvvvvv/p/17174765.html