• oracle--函数


    函数

    1、数值函数

    (1)Ceil(n)

    返回大于或等于n的最小整数

    (2)Power(m,n)

    返回m的n次方

    (3)Trunc(m[,n])

    对m截取操作,当n大于0时,表示截取到小数点右边第n位;当n省略时,表截取m的小数部分;当n小于0时,表示截取到小数点左侧第n位

    2、字符函数

    (1)Concat((char1,char2)

    用于字符连接,返回字符串char2与字符串char1连接后的字符串

    (2)Instr(char1,char2,[m[,n]])

    返回指定字符串char2在char1中的位置,其中m表示起始搜索位置,n表示字符串char2在字符串char1中出现的次数。

    (3)Lpad(char1,n[,char2])

    在字符串char1左侧填充字符串char2使其长度达到n。若字符串char1长度大于n,则返回字符串char1左侧的n个字符

    (4)Replace(char1,char2,char3)

    把字符串char1中的字符串char2用字符串char3取代

    (5)Substr(char,m[,n])

    用于获取字符串char的子串,m表示子串的起始位置,n表示子串的长度

    (6)Trim([leading|trailing|both]char FROM string)

    从字符串的头、尾货两端截掉字符char

    3、日期函数

    (1)Months_between(d1,d2)

    返回d1和d2两个日期之间相差的月数

    (2)Sysdate

    返回当前系统的日期时间

    (3)To_char(d,[,fmt][,’nlsparam’])

    将日期时间转换为特定格式的字符串

    (4)To_date(char[,fmt][,’nlsparam’])

    将符合特定格式的字符串char转换为日期

    4、转换函数

    (1)Cast(expr AS datatype)

    将表达式按指定的类型返回

    (2)To_char(char)

    (3)To_number(char[,fmt][,’nlsparam’])

    将符合特定格式的字符串char转换为数值

    5、其他函数

    (1)Decode()

    形式:decode(expr,search1,result1[,search2,result2,…][,default])

    说明:如果search1=expr,返回result1,如果search2=expr,则返回result2,以此类推。

    (2)Nvl()

    形式:nvl(expr1,expr2)

    说明:若expr1为null,则返回expr2,否则返回expr1

    (3)Nvl2()

    形式:Nvl2(expr1,expr2,expr3)

    说明:若expr1为null,则返回expr3,否则返回expr2

    (4)Nullif()

    形式:nullif(expr1,expr2)

    说明:若expr1与expr2相等则返回null,否则返回expr1

    (5)Greatest()

    形式:greatest(expr1,expr2,…)

    说明:返回几个表达式中的最大值

    (6)Least()

    Least(expr1,expr2,…)

    返回几个表达式中的最小值

    (7)Coalesce(expr1,[,expr2][,expr3]…)

    返回参数列表中第一个非空表达式的结果

  • 相关阅读:
    iOS开发_广告接入
    iOS开发_项目中一次性屏蔽打印多余内容的方法
    iOS开发_屏蔽第三方库FFmpeg的日志输出
    iOS开发_应用项目的架构选型
    iOS开发_多线程_基础知识点
    Xcode13 新建项目后找不到Products目录怎么办?
    Linux教程
    iOS Invalid App Store Icon The App Store Icon can't be transparent nor contain an alpha channel
    FastReport打印DataTable
    windows服务
  • 原文地址:https://www.cnblogs.com/chinas/p/6423572.html
Copyright © 2020-2023  润新知