oracle取字符串长度的函数length()和hengthb()【转】

原文:http://space.itpub.net/161195/viewspace-613263

lengthb(string)计算string所占的字节长度 :返回字符串的长度,单位是字节


length(string)计算string所占的字符长度 :返回字符串的长度,单位是字符

对于单字节字符,LENGTHB和LENGTH是一样的.

如可以用length(‘string’)=lengthb(‘string’)判断字符串是否含有中文。

转自网络:

http://topic.csdn.net/t/20040630/16/3135181.html

http://space.itpub.net/?uid-231499-action-viewspace-itemid-63770

select length('我') from dual --返回1


select lengthb('我') from dual --返回2


select length('AB') from dual --返回2


select lengthb('AB') from dual --返回2

猜你喜欢

转载自zhglhy.iteye.com/blog/1977932
今日推荐