case length(cast(bal.ASSET_ACCT as string)) when 12 then '资金账户'  WHEN 16 THEN '理财帐户' ELSE  '其他' end

case后可以加入条件在写when,length(String) 为string的字符长度

length(),括号里不仅可以是string的字符串,还可以可是int类型的,但是不可以是bigint类型的

select length(cast(123 as  int)) from dual    --正常运行

select length(cast(123 as  bigint)) from dual    --invalid datatype 报错

 

相关文章:

  • 2021-10-11
  • 2021-05-08
  • 2021-08-01
  • 2021-12-07
  • 2021-08-26
  • 2021-07-01
  • 2021-12-21
  • 2021-08-25
猜你喜欢
  • 2021-11-19
  • 2021-09-11
相关资源
相似解决方案