zoukankan      html  css  js  c++  java
  • oracle--trunc与to_char的区别

    trunc取得是天(可比较),而to_char取得是数值(可计算):
    但trunc(date) 具有与to_char(date) 相似的功能,但有区别:
     
    trunc(sysdate,'cc')   取当世纪的第一天     to_char(sysdate,'cc')   取当世纪数值
    trunc(sysdate,'yyyy') 取当年的第一天       to_char(sysdate,'yyyy') 取当年数值
    trunc(sysdate,'iyyy') 取上年的最后一天     to_char(sysdate,'iyyy') 取当年数值
    trunc(sysdate,'q')    取当季第一天         to_char(sysdate,'iyyy') 取当季数值
    trunc(sysdate,'mm')   取当月第一天         to_char(sysdate,'mm')   取当月数值
    trunc(sysdate,'ww')   取当周第一天(周二)   to_char(sysdate,'ww')   取当周数值(第几周)
    trunc(sysdate,'iw')   取当周第一天(周一)   to_char(sysdate,'iw')   取当周数值(第几周)
  • 相关阅读:
    安装 Android 运行环境
    Sea.js
    css hack 兼容性
    solr全文检索基本原理
    Solr初步学习
    jquery中ajax的用法
    Javascript的模块化编程
    html 标签
    CSS盒子模型
    python 初学03 Eric+PyQt+python IDE与界面程序
  • 原文地址:https://www.cnblogs.com/cyfighting/p/6108806.html
Copyright © 2011-2022 走看看