如何使用oracle数据库的length()、lengthb()、replace()、regexp
阿里云国内75折 回扣 微信号:monov8 |
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6 |
- length()、lengthb()
lengthb(string)
获取string所占的字节长度返回字符串的长度单位是字节length(string)
获取string所占的字符长度返回字符串的长度单位是字符- 对于单字节字符,length()和lengthb()是一样的。
- 可以用length(‘string’)=lengthb(‘string’)判断字符串是否含有中文。
select lengthb('帅') from dual;
select lengthb('帅,a,b,c') from dual;
select length('帅,a,b,c') from dual
- replace()
- replace()函数是用另外一个值来替代串中的某个值。
REPLACE ( char, search_string [, replace_string])
如果没有指定replace_string 变量的值那么当发现search_string 变量的值时就将其删除。
select replace('帅,a,b,c',',','?') from dual;
select replace('帅,a,b,c',',') from dual;
- regexp_substr()
REGEXP_SUBSTR(source_char, pattern [, position [, occurrence [, match_parameter ]]]);
select regexp_substr('帅,aa,BB,cc,','[^,]+',1,3,'c') from dual;
阿里云国内75折 回扣 微信号:monov8 |
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6 |