to_char.doc


文档分类:高等教育 | 页数:约14页 举报非法文档有奖
1/14
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/14
文档列表 文档介绍
TO_CHAR Function With Date Date Format Model Elements YYYY FULL year innumbers YEAR year spelled out MM2-digit value for month MONTH Full name ofthe month MONName ofmonth,three-letter abbreviation RMRuman numeral month DY3-letter abbreviation ofthe day ofthe week DAYFull name ofthe day SCC entury ;Sprefixes BCdate with - Years indates YYYY orSYYYY Year ;Sprefixes BCdate with - YYY orYYorYLast 3,2,1 digit(s) ofyear Y,YYY Year ma inthis position IYYY orIYY orIYorI4,3,2 or1digit year based onthe ISO standard SYEAR orYEAR year spelled out;S prefixes BCdate with - BCorADBC/AD indicator . . BC/AD indicator with periods QQuarter ofyear WWorWWeek ofthe year ormonth DDD orDDorDDay ofyear,month,week JJulian day;the number ofdays since 31december 4713 BC AMorPMMeridian indicator . . Meridian indicator with periods HHorHH12 orHH24 Hour ofday orhour(12) orhour(24) MIMinute(0-59) SSSecond(0-59) SSSSS Seconds past midnight(0-86399) THOrdinal Number SPSpelled-out number THSP orSPTH Spelled-out Ordinal number /.,Punctuation isreproduced inthe result "of the" Quoted String isreproduced inthe result *: fm 前缀用来去掉 0 如: Select to_char(to_date( '2007-10-05' , 'yyyy-mm-dd' ), 'fmdd' ) From dual; 结果为: 5 Select to_char(to_date( '2007-10-05' , 'yyyy-mm-dd' ), 'dd' ) From dual; 结果为: 05 TO_CHAR Function With Numbers 例: Select to_char( , '' ) From dual; 结果: .99 ( fm去掉左边空格) Select to_char( , 'fm99 0 .99' ) From dual; 结果: 例: T o_char 和 to_date 组合用法 to_char 用于日期转换成字符串时, fm 去掉前导 0,如果格式穿里边重复使用 fm 会发生什么事情? 请看: SQL> select to_char(sysdate,'yy-mm-dd') from dual; TO_CHAR(SYSDATE,'YY-MM-DD') --------------------------- 08-07-16 SQL> select to_char(sysdate,'fmyy-mm-dd') from dual; TO_CHAR(SYSDATE,'FMYY-MM-DD') ----------------------------- 8-7-16 SQL> select to_char(sysdate,'yy-fmmm-dd') from dual; TO_CHAR(SYSDATE,'YY-FMMM-DD') ----------------------------- 08-7-16 SQL> select to_char(sysdate,'fmyy-fmmm-dd') from dual; TO_CHAR(SYSDATE,'FMYY-FMMM-DD' ------------------

to_char 来自淘豆网m.daumloan.com转载请标明出处.

非法内容举报中心
文档信息
  • 页数14
  • 收藏数0 收藏
  • 顶次数0
  • 上传人taotao0d
  • 文件大小141 KB
  • 时间2017-02-27