如果当日日期是:2007-9-19
那么有以下结果:
select trunc(sysdate ,'dd') from dual ; -- > 2007-9-19
select trunc(sysdate ,'yyyy') from dual ; -- >2007-1-1
select trunc(sysdate ,'mm') from dual ; -- >2007-9-1
计算两个日期相差天数的方法:
select trunc(sysdate,'dd')-to_date('27/09/2010','dd/mm/yyyy') from dual;