首页 > 开发 > Oracle > 正文

Oracle全角数字转换半角数字

2019-10-20 13:38:30
字体:
来源:转载
供稿:网友

数据库表 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,全角数字,半角数字

总结

以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,谢谢大家对CuoXin错新网的支持。


注:相关教程知识阅读请移步到oracle教程频道。
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表