Oracle全角数字转换半角数字
时间:2020-11-06 14:05 作者:admin
数据库表 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)
总结
以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,谢谢大家对脚本之家的支持。如果你想了解更多相关内容请查看下面相关链接
(责任编辑:admin)