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

oracle函数

时间:2015-02-28 10:06:07      阅读:167      评论:0      收藏:0      [点我收藏+]

标签:

1.字符串操作

1.1 substr(string,start,count)

取子字符串,start开始,count

SQL> select substr(13088888888,3,8) from dual;

SUBSTR(

--------

08888888

1.2 instr(C1,C2,I,J)

在一个字符串中搜索指定的字符,返回发现指定的字符的位置;

  C1 被搜索的字符串

  C2 希望搜索的字符串

  I 搜索的开始位置,默认为1

  J 出现的位置,默认为1

SQL> select instr(oracle traning,ra,1,2) instring from dual;

INSTRING

---------

9

1.3 REPLACE(string,s1,s2)

  string 希望被替换的字符或变量  
  s1 被替换的字符串
  s2 要替换的字符串
SQL> select replace(he love you,he,i) from dual;
REPLACE(H
----------
i love you

 

oracle函数

标签:

原文地址:http://www.cnblogs.com/a198720/p/4304735.html

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