oracle得到的两个字段进行相加,要求都是number类型的,如果两个是字符串会自动转成number类型(前提是能够转)

select a+b from (
select '1' a,'2' b from z_user
)  对的,输出3

 

select a+b from (
select '1a' a,'2' b from z_user
)  错的,无法相加

 

select a||b from (
select '1a' a,'2' b from z_user
)对的,输出1a2

相关文章:

  • 2022-12-23
  • 2021-11-05
  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
  • 2022-01-01
  • 2021-09-24
  • 2021-09-20
猜你喜欢
  • 2021-12-12
  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案