好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

Oracle全角数字转换半角数字

数据库表 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)

总结

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

原文链接:https://blog.csdn.net/qq_39135609/article/details/82593138

查看更多关于Oracle全角数字转换半角数字的详细内容...

  阅读:24次