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 ;  

    常规函数

  • 相关阅读:
    感知机预测NBA总冠军
    java 一维数组
    2020-11-25
    2020-11-24学习日记
    Java语言概述
    人脸情绪识别系统---测试心得
    结对编程,问题不大
    结对编程之队友代码赏析
    项目测试心得——基于微信的图书销售小程序
    数据库设计心得
  • 原文地址:https://www.cnblogs.com/lm970585581/p/7105045.html
Copyright © 2011-2022 走看看