select to_char(ascii('A')) 结果, 'ascii' 函数名, '获得相应的asic值' 说明 from dual union select to_char(chr(54740)), 'chr', '由ascii变成字符' zhao from dual union select concat('010-', '88888888') || '转23', 'concat', '拼接两个字符串' from dual union select initcap('smith'), 'initcap', '把第一个字母变成大写' from dual union select to_char(instr('oracle traning', 'ra', 1, 2)), 'instr', '在一个字符串中搜索指定的字符,返回发现指定的字符的位置C1 被搜索的字符串C2 希望搜索的字符串I 搜索的开始位置,默认为1J 出现的位置,默认为1' instring from dual union select to_char(length('abcd')), 'length', '获得字符串长度' from dual union select lower('AaBbCcDd') AaBbCcDd, 'lower', '返回字符串,并将所有的字符小写' from dual union select upper('AaBbCcDd'), 'upper', '返回字符串,并将所有的字符大写' from dual union select lpad(rpad('gao', 10, '*'), 17, '*'), 'rpad,lpad', 'RPAD 在列的右边粘贴字符,LPAD 在列的左边粘贴字符' from dual union select ltrim(rtrim(' gao qian jing ', ' '), ' '), 'ltrim,rtrim', 'LTRIM 删除左边出现的字符串,RTRIM 删除右边出现的字符串' from dual union select substr('13088888888', 3, 8), 'substr', '取子字符串,从start开始,取count个' from dual union select replace('he love you', 'he', 'i'), 'replace', 'string 希望被替换的字符或变量,s1被替换的字符串,s2 要替换的字符串 ' from dual union select 'xm', '', '' from dual where soundex('weather') = soundex('weather') union select to_char(abs(100)) || to_char(abs(-100)), 'abs', '返回指定值的绝对值' from dual union select TRIM('s' from 'string'), 'trim', '去掉字符后面的东西' from dual union select to_char(acos(-1)), 'acos', '给出反余弦的值' from dual union select decode('2', '2', 'none'), 'decode', 'asdf' from dual
执行结果:
结果 | 函数名 | 说明 | |||||||||||||||||
1 | *******gao******* | rpad,lpad | RPAD 在列的右边粘贴字符,LPAD 在列的左边粘贴字符 | ||||||||||||||||
2 | 010-88888888转23 | concat | 拼接两个字符串 | ||||||||||||||||
3 | 08888888 | substr | 取子字符串,从start开始,取count个 | ||||||||||||||||
4 | 100100 | abs | 返回指定值的绝对值 | ||||||||||||||||
5 | 3.1415926535897932384626433832795028842 | acos | 给出反余弦的值 | ||||||||||||||||
6 | 4 | length | 获得字符串长度 | ||||||||||||||||
7 | 65 | ascii | 获得相应的asic值 | ||||||||||||||||
8 | 9 | instr | 在一个字符串中搜索指定的字符,返回发现指定的字符的位置C1 被搜索的字符串C2 希望搜索的字符串I 搜索的开始位置,默认为1J 出现的位置,默认为1 | ||||||||||||||||
9 | AABBCCDD | upper | 返回字符串,并将所有的字符大写 | ||||||||||||||||
10 | Smith | initcap | 把第一个字母变成大写 | ||||||||||||||||
11 | aabbccdd | lower | 返回字符串,并将所有的字符小写 | ||||||||||||||||
12 | gao qian jing | ltrim,rtrim | LTRIM 删除左边出现的字符串,RTRIM 删除右边出现的字符串 | ||||||||||||||||
13 | i love you | replace | string 希望被替换的字符或变量,s1被替换的字符串,s2 要替换的字符串 | ||||||||||||||||
14 | none | decode | asdf | ||||||||||||||||
15 | tring | trim | 去掉字符后面的东西 | ||||||||||||||||
16 | xm | ||||||||||||||||||
17 | 赵 | chr | 由ascii变成字符 |
1 |