--Oracle trunc()函数的用法/**************日期********************/1.select trunc(sysdate) from dual --2013-01-06 今天的日期为2013-01-062.select trunc(sysdate, 'mm') from dual --2013-01-01 返回当月第一天.3.select trunc(sysdate,'yy') from dual --2013-01-01 返回当年第一天4.select…
Oracle trunc()函数的用法 /**************日期********************/1.select trunc(sysdate) from dual --2013-01-06 今天的日期为2013-01-062.select trunc(sysdate, 'mm') from dual --2013-01-01 返回当月第一天.3.select trunc(sysdate,'yy') from dual --2013-01-01 返回当年第一天4.select…
--Oracle trunc()函数的用法/**************日期********************/1.select trunc(sysdate) from dual  --2011-3-18  今天的日期为2011-3-182.select trunc(sysdate, 'mm')   from   dual  --2011-3-1    返回当月第一天.3.select trunc(sysdate,'yy') from dual  --2011-1-1       返回当年…
select to_char(trunc(add_months(last_day(sysdate), -1) + 1), 'yyyy-mm-dd') "本月第一天", to_char(last_day(sysdate), 'yyyy-mm-dd') "本月最后一天" --Oracle trunc()函数的用法 /**************日期********************/ 1.select trunc(sysdate) from dual  --201…
Oracle trunc()函数的用法   --Oracle trunc()函数的用法/**************日期********************/1.select trunc(sysdate) from dual  --2011-3-18  今天的日期为2011-3-182.select trunc(sysdate, 'mm')   from   dual  --2011-3-1    返回当月第一天.3.select trunc(sysdate,'yy') from dual …
1.TRUNC(for dates) TRUNC函数为指定元素而截去的日期值. 其具体的语法格式如下: TRUNC(date[,fmt]) 其中: date 一个日期值 fmt 日期格式,该日期将由指定的元素格式所截去.忽略它则由最近的日期截去 下面是该函数的使用情况: TRUNC(TO_DATE('24-Nov-1999 08:00 pm'),'dd-mon-yyyy hh:mi am') ='24-Nov-1999 12:00:00 am' TRUNC(TO_DATE('24-Nov-199…
--Oracle trunc()函数的用法/**************日期********************/1.select trunc(sysdate) from dual  --2011-3-18  今天的日期为2011-3-182.select trunc(sysdate, 'mm')   from   dual  --2011-3-1    返回当月第一天.3.select trunc(sysdate,'yy') from dual  --2011-1-1       返回当年…
原文地址:http://www.cnblogs.com/gengaixue/archive/2012/11/21/2781037.html 1.TRUNC(for dates) TRUNC函数为指定元素而截去的日期值. 其具体的语法格式如下: TRUNC(date[,fmt]) 其中: date 一个日期值 fmt 日期格式,该日期将由指定的元素格式所截去.忽略它则由最近的日期截去 下面是该函数的使用情况: TRUNC(TO_DATE('24-Nov-1999 08:00 pm'),'dd-mo…
--Oracle trunc()函数的用法/**************日期********************/1.select trunc(sysdate) from dual --2013-01-06 今天的日期为2013-01-062.select trunc(sysdate, 'mm') from dual --2013-01-01 返回当月第一天.3.select trunc(sysdate,'yy') from dual --2013-01-01 返回当年第一天4.select…
Oracle TRUNC函数可以截取数字和日期类型:截取日期:select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual; --显示当前时间 select trunc(sysdate,'year') from dual; --截取到年(本年的第一天) select trunc(sysdate,'q') from dual; --截取到季度(本季度的第一天) select trunc(sysdate,'month') from dual; -…