oracle 常用内置函数

一. 字符串相关函数

  1.Lower  :Lower(str) 将str 中所有字母小写

  2.upper :upper(str) 将str 中 所有字母大写

  3.initcap :initcap(str) 将str 中首字母大写,以空格来区分首字母

  4.lenght :lenght(str) 返回str 长度

  5.replece : replece(str,s1,s3)  字符串替换,将str 中子串s1 替换为s3

  6.concat(str1,str2): 连接两个字符串

  7.reverse : reverse(str) 反转字符串

  8.Substr(str,start,count): 截取子串,从start开始截取count个

  9.instr : instr(src,search,start,number)  搜索指定的字符串并且返回指定字符串的位置

  10.rtrim , ltrim : rtrim(str,search)  删除左边(右边)出现的字符串。

  11.Rap | Lpad(str,lenght,char) :在字符串右边(左)粘贴字符。

二. 日期相关函数

  to_char()      select to_char(sysdate ,'yyyy-mm-dd hh24:mi:ss') from dual;

  to_date()     

  add_months() select add_months(sysdate,2) from dual 加上月份。

  next_day(date,week) week 1-7;返回下一个周的第week天。

posted @ 2020-06-02 21:29  徐大侠拯救世界  阅读(264)  评论(0编辑  收藏  举报