1.select trunc(sysdate) from dual --2021-8-25 今天的日期为2021-8-252.select trunc(sysdate,'dd') from dual --2021-8-25 返回当前年月日
3.select trunc(sysdate,'mm') from dual --2021-8-1 返回当月第一天
4.select trunc(sysdate,'yy') from dual --2021-1-1 返回当年第一天
5.select trunc(sysdate,'yyyy') from dual --2021-1-1 返回当年第一天
6.select trunc(sysdate,'d') from dual --2021-8-22(星期天)返回当前星期的第一天
7.select trunc(sysdate,'hh24') from dual --2021-8-2508:00:00 当前时间为8:418.select trunc(sysdate,'mi') from dual --2021-8-2514:41:00TRUNC()函数没有秒的精确
2.oracle 取整的几种方法
1.select ceil(1.001) value from dual --2 向上取整
2.select floor(1.001) value from dual --1 向下取整
3.select trunc(1.002) value from dual --1 截取取整
4.select round(1.501) value from dual --2 四舍五入