Oracle全角数字转换半角数字

来自:互联网
时间:2021-01-09
阅读:

数据库表 test 字段 id name age

全角数字:1234 半角数字:1234

length和lengthb的区别:

length(1234) 4 lengthb(1234) 8

to_single_byte函数用法:

to_single_byte(1234) 1234

查找所有全角的数字:

select age from test where lengthB(age) >4

替换全角的为半角的:

update test t1 set t1.age = (select to_single_byte(t2.age) from test t2 where t1.id = t2.id)

Oracle全角数字转换半角数字

总结

以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,谢谢大家对的支持。如果你想了解更多相关内容请查看下面相关链接

返回顶部
顶部