码迷,mamicode.com
首页 > 数据库 > 详细

oracle中的trim函数

时间:2019-08-02 09:14:16      阅读:167      评论:0      收藏:0      [点我收藏+]

标签:ret   nbsp   指定   rom   ora   单个字符   rtrim(   acl   for   

 trim(‘字符1‘ from ‘字符串2‘) ,字符1只能是单个字符。

1. trim()删除字符串两边的空格。
2. ltrim()删除字符串左边的空格。
3. rtrim()删除字符串右边的空格。
4. trim(‘字符1‘ from ‘字符串2‘) 分别从字符2串的两边开始,删除指定的字符1。
5. trim([leading | trailing | both] trim_char from string) 从字符串String中删除指定的字符trim_char。
leading:从字符串的头开始删除。
trailing:从字符串的尾部开始删除。
borth:从字符串的两边删除。
6. tim()只能删除半角空格。

For example:
trim(‘ tech ‘) would return ‘tech‘;
trim(‘ ‘ from ‘ tech ‘) would return ‘tech‘;
trim(leading ‘0‘ from ‘000123‘) would return ‘123‘;
trim(trailing ‘1‘ from ‘Tech1‘) would return ‘Tech‘;
trim(both ‘1‘ from ‘123Tech111‘) would return ‘23Tech‘;

oracle中的trim函数

标签:ret   nbsp   指定   rom   ora   单个字符   rtrim(   acl   for   

原文地址:https://www.cnblogs.com/Mellita/p/11286538.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!