zoukankan      html  css  js  c++  java
  • oracle常用函数介绍

    字符函数

    数学函数

    日期函数

    转换函数

    to_char(数字/日期)是把日期或数字转换为字符串

    • 将数字转换成指定格式
    • to_char(1210.73, '9999.9')           -- would return '1210.7'
      to_char(1210.73, '9,999.99')      -- would return '1,210.73'
      to_char(1210.73, '$9,999.00')   --  would return '$1,210.73'
      to_char(21, '000099')           -- would return '000021'
    • 将日期转换成指定格式
    • to_char(sysdate, 'yyyy/mm/dd');--would return '2003/07/09'
      select to_char(sysdate, 'yyyy-mm-dd  hh24:mi:ss')  from a;    ------> 2015-08-28  14:43:15
      select to_char(sysdate, 'yyyy-mm-dd  hh12:mi:ss')  from a;    ------> 2015-08-28  02:43:15
      to_char(sysdate, 'yyyy/mm/dd');--would return '2003/07/09'
      to_char(sysdate,'dd-mm-yyyy')--按dd-mm-yyyy格式转换23-05 -2016
      to_char(sysdate, 'Month DD, YYYY');--would return '10月 21, 2015'
      to_char(sysdate, 'FMMonth DD, YYYY');--would return 'July 9, 2003'
      to_char(sysdate, 'MON DDth, YYYY');--would return 'JUL 09TH, 2003'
      to_char(sysdate, 'FMMON DDth, YYYY');--would return 'JUL 9TH, 2003'
      to_char(sysdate, 'FMMon ddth, YYYY');--would return 'Jul 9th, 2003'
      to_char(sysdate, 'FMMonth DD, YYYY');--would return 'July 9, 2003'
      to_char(sysdate, 'FMMON DDth, YYYY');--would return 'JUL 9TH, 2003'
      to_char(sysdate, 'FMMon ddth, YYYY');--would return 'Jul 9th, 2003'

    to_number(字符串)  将给出的字符转换为数字

    select to_number('123') from a ;  

    常规函数

  • 相关阅读:
    计网第一章——基本概念
    计网第二章——应用层
    命令行测试邮件发送工具mailsend-go
    CentOS-7-x86_64-DVD-2009 rpm包列表(centos7.9)
    CentOS-7-x86_64-Everything-2009 rpm包列表(CentOS7.9)
    Centos发行版ISO镜像中rpm包列表
    nginx使用记录
    centos resolv.conf
    python cookbook
    ansible中变量和主机名
  • 原文地址:https://www.cnblogs.com/lm970585581/p/7105045.html
Copyright © 2011-2022 走看看