trunc function
Date is the necessary parameter
Syntax format trunc (DATE,[FMT])
Select Sysdate from dual; --Current time 2016/9/7 10:32:04select trunc (sysdate) from dual;--take the day 2016/9/7select trunc (sysdate, ' yyyy ') from dual; --Take the first day of the year 2016/1/1select trunc (sysdate, ' mm ') from dual;--take the first day of the month 2016/9/1select trunc (sysdate, ' DD ') from dual; --Take the day 2016/9/7select trunc (sysdate, ' d ') from dual; --Returns the first day of the current week 2016/9/4select trunc (sysdate, ' hh ') from dual;--Returns the current time, accurate to hours 2016/9/7 10:00:00select trunc ( Sysdate, ' mi ') from dual; --Returns the current time, exactly to the minute 2016/9/7 10:32:00
Trunc (for number)
Select Trunc (2016.11) from dual; --2016select trunc (2016.99) from dual; --2016select trunc (2016.99,1) from dual; --2016.9select trunc (2016.99,3) from dual; --2016.99select trunc (2016.99,-1) from dual; --2010select trunc (2016.99,-2) from dual; --2000select trunc (2016.99,-4) from dual; --0select trunc (2016,1) from dual; --2016select trunc (2016,-1) from dual; In
Oracle Trunc () function