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 ;  

    常规函数

  • 相关阅读:
    webpack打包注意事项
    打印内存, 打印16进制
    c++ 字符集转换
    RegSvr32 加载失败,找不到指定的模块
    错误码设计
    mfc 移动绘制的图形
    获取、设置光标
    c++ 函数中定义函数
    python linux 自动补全 tab.py
    3.4.5节 完整神经网络样例程序
  • 原文地址:https://www.cnblogs.com/lm970585581/p/7105045.html
Copyright © 2011-2022 走看看