ORA-00932: inconsistent datatypes: expected NUMBER got CHAR

ORA-00932: inconsistent datatypes: expected NUMBER got CHAR:

获取的目标类型与源类型不一致,多出现在case when 语句中,when的结果类型与源类型不一致的情况,如:

case u.user_type_id when '1' then '经理' else '普通职员'

此时,user_type_id是number类型的,就会报此错误,将when后的 ‘1’ 改成 1 即可

猜你喜欢

转载自blog.csdn.net/ethan_10/article/details/80352466