Oracle截取字符串去掉字段末尾指定长度的字符
作者:河岸飞流 时间:2024-01-23 00:57:51
lengthb(string)计算string所占的字节长度:返回字符串的长度,单位是字节
length(string)计算string所占的字符长度:返回字符串的长度,单位是字符
eg:
//去掉该字段后面15位字符串
select t.depre_name,
substr(t.depre_name, 0, (length(t.depre_name) - 16))
from table t where t.del_flag = '0'
【备注】一个汉字在Oracle数据库里占多少字节跟数据库的字符集有关,UTF8时,长度为三
PS:oracle去掉字符串中所有指定字符
Select Replace(字段名,'指定字符','替换字符') From 表名
例子:select replace('de.5d','.','') from dual 显示结果:de5d
来源:http://www.cnblogs.com/xieshuang/archive/2016/08/03/5731466.html
标签:oracle,截取,字符串
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
mysql、mssql及oracle分页查询方法详解
2024-01-21 15:11:34
深入分析python中整型不会溢出问题
2022-11-20 01:19:13
python 使用tkinter与messagebox写界面和弹窗
2022-03-15 10:38:56
![](https://img.aspxhome.com/file/2023/2/70782_0s.png)
在PB中如何让用户只能修改新增的数据
2023-11-27 15:59:52
浅谈PHP的数据库接口和技术
2024-05-02 17:13:49
PyQT5 emit 和 connect的用法详解
2022-02-08 15:15:11
![](https://img.aspxhome.com/file/2023/4/87944_0s.jpg)
Python开发微信公众平台的方法详解【基于weixin-knife】
2023-03-09 12:05:43
MySQL实现配置主从复制项目实践
2024-01-15 16:54:20
![](https://img.aspxhome.com/file/2023/8/122908_0s.jpg)
微信小程序报错: thirdScriptError的错误问题
2024-04-19 09:47:43
![](https://img.aspxhome.com/file/2023/2/136162_0s.jpg)
Linux下用Python脚本监控目录变化代码分享
2021-03-30 20:15:59
Golang中异常处理机制详解
2024-02-17 17:05:50
![](https://img.aspxhome.com/file/2023/3/107303_0s.png)
python pandas分割DataFrame中的字符串及元组的方法实现
2022-09-10 09:30:14
![](https://img.aspxhome.com/file/2023/9/99509_0s.png)
浏览器针对单服务器连接数问题
2008-05-12 22:27:00
Opera浏览器简介
2009-02-05 20:56:00
flask循环导入的问题解决
2023-10-01 10:28:52
如何利用python 读取配置文件
2023-11-08 14:40:21
![](https://img.aspxhome.com/file/2023/4/83814_0s.png)
Python map和reduce函数用法示例
2022-06-21 09:02:25
谈谈CSS样式表的命名规范
2007-10-08 12:41:00
Python中操作mysql的pymysql模块详解
2024-01-14 08:14:32
Python编程语言的35个与众不同之处(语言特征和使用技巧)
2023-11-21 23:09:25