当前位置: 移动技术网 > IT编程>数据库>Oracle > ORACLE全角数字转半角数字的方法

ORACLE全角数字转半角数字的方法

2018年02月06日  | 移动技术网IT编程  | 我要评论

演讲口才,又名黑河站长网,勾女秘籍

数据库表 test 字段 id name age

全角数字:123456

半角数字:123456

length和lengthb的区别:

length(123456) 6

lengthb(123456) 12

to_single_byte函数用法:

to_single_byte(123456) 123456

查找所有全角的数字:

select age from test where lengthB(age) >6

替换全角的为半角的:

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

ok!!

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网