Oracle trunc()函数的用法
Oracle trunc()函数的用法 日期 select trunc(sysdate) from dual --2019/7/21 今天的日期为2019/7/21 select trunc(sysdate, 'mm') from dual --2019/7/1 返回当月第一天. select trunc(sysdate,'yy') from dual --2019/1/1 返回当年第一天 select trunc(sysdate,'dd') from dual --2019/7/21 返回当前年月日(当天) select trunc(sysdate,'yyyy') from dual --2019/1/1返回当年第一天 select trunc(sysdate,'dd') from dual --2019/7/21 (星期天)返回当前星期的第一天 select trunc(sysdate, 'hh') from dual --2019/7/21 23:00:00 当前时间为23:02(整点) select trunc(sysdate, 'mi') from dual --2019/7/21 23:02:00 TRUNC()函数没有秒的精确 数字 TRUNC(number,num_digits) Number 需要截尾取整的数字。 Num_digits 用于指定取整精度的数字