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,oracle traning为被搜索串,ra为要搜索的串,1为oracle traning的开始位置,2为出现次数' 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变成字符

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值