2008-06-05
ORACLE 全角数字转半角数字
数据库表 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!!
发表评论
- 浏览: 73566 次
- 性别:

- 来自: 西安

- 详细资料
搜索本博客
我的相册
图像011
共 7 张
共 7 张
链接
最新评论
-
TinyMCE3.0.8简体中文字体 ...
正找呢 太感谢了
-- by itshu -
Hibernate的<query>标签 ...
hibernate中有没有像ibatis中<select>标签中用于拼接查 ...
-- by kilavater -
TinyMCE3.0.8简体中文字体 ...
非常棒,谢谢楼主!
-- by rubyrock -
(转)广为流传的一个关于 ...
好长,不过有见地
-- by wenson -
闲言碎语
我觉的迷茫那个解释 解释的很好 呵呵
-- by zhangzhaofeng






评论排行榜