好多常用oracle函数

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,lpadRPAD  在列的右边粘贴字符,LPAD  在列的左边粘贴字符 
2010-88888888转23concat拼接两个字符串 
308888888substr取子字符串,从start开始,取count个 
4100100abs返回指定值的绝对值 
53.1415926535897932384626433832795028842 acos给出反余弦的值 
64length获得字符串长度 
765ascii获得相应的asic值 
89instr在一个字符串中搜索指定的字符,返回发现指定的字符的位置C1    被搜索的字符串C2    希望搜索的字符串I     搜索的开始位置,默认为1J     出现的位置,默认为1
9AABBCCDDupper返回字符串,并将所有的字符大写 
10Smithinitcap把第一个字母变成大写 
11aabbccddlower返回字符串,并将所有的字符小写 
12gao qian jingltrim,rtrimLTRIM  删除左边出现的字符串,RTRIM  删除右边出现的字符串 
13i love youreplacestring   希望被替换的字符或变量,s1被替换的字符串,s2 要替换的字符串  
14nonedecodeasdf 
15tringtrim去掉字符后面的东西 
16xm   
17chr由ascii变成字符 

 

 

 

1  
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值