發(fā)布時(shí)間:2022年04月15日 04:06:32分享人:致命誘惑來源:互聯(lián)網(wǎng)30
trim一般都是用在刪除字符串兩邊的空格。實(shí)際上,trim也可以用來刪除字符串兩邊的指定字符。并且trim指定刪除的字符串只能是單個(gè)字符。如trim('字符1'from '字符串2'),字符1 只能是單個(gè)字符。
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()只能刪除半角空格。
Forexample:
trim('tech')wouldreturn 'tech';
trim(''from'tech')wouldreturn 'tech';
trim(leading '0' from'000123')wouldreturn '123';
trim(trailing '1'from 'Tech1')would return 'Tech';
trim(both '1' from'123Tech111')wouldreturn '23Tech';
轉(zhuǎn)載http://apps.hi.baidu.com/share/detail/30713428
愛華網(wǎng)本文地址 » http://www.klfzs.com/a/25101015/244028.html
更多閱讀

oracle decode函數(shù)使用方法——簡介decode()函數(shù)是ORACLE PL/SQL是功能強(qiáng)大的函數(shù)之一,目前還只有ORACLE公司的SQL提供了此函數(shù),其他數(shù)據(jù)庫廠商的SQL實(shí)現(xiàn)還沒有此功能。oracle decode函數(shù)使用方法——工具/原料·軟件環(huán)境: 1、Wi

Oracle中函數(shù)以前介紹的字符串處理,日期函數(shù),數(shù)學(xué)函數(shù),以及轉(zhuǎn)換函數(shù)等等,還有一類函數(shù)是通用函數(shù)。主要有:NVL,NVL2,NULLIF,COALESCE,這幾個(gè)函數(shù)用在各個(gè)類型上都可以。下面簡單介紹一下幾個(gè)函數(shù)的用法。在介紹

作者:萬昆日期:20130605 準(zhǔn)備表和測試數(shù)據(jù)建表create tablegroup_test (group_id int, job string, name string, salaryint); 準(zhǔn)備數(shù)據(jù)文件 10 Coding Bruce 100010 Programmer Clair100010 Architect G

http://www.huomo.cn/database/article-377.htmlOracle 分析函數(shù)更新: 2010-07-02字體: 【大 中 小】點(diǎn)擊: 32分析函數(shù)是oracle816引入的一個(gè)全新的概念,為我們分析數(shù)據(jù)提供了一種簡單高效的處理方式.在分析函數(shù)出現(xiàn)以前,我們必須

round(input_value,decimal_places_of_precision),例如: SQL> select round(1234.5678,4) from dual; ROUND(1234.5678,4) ------------------ 1234.5678 SQL> select round(1234.5678,3) from dual; ROUND(1