trunc in sql

Solutions on MaxInterview for trunc in sql by the best coders in the world

showing results for - "trunc in sql"
Lena
27 Jun 2016
1SELECT TRUNC(TO_DATE('27-OCT-92','DD-MON-YY'), 'YEAR')
2  "New Year" FROM DUAL;
3 
4New Year
5---------
601-JAN-92 
7
Samuel
30 Aug 2020
1-- trunc(date, format)						DUAL is for Oracle
2SELECT trunc(sysdate) FROM DUAL;            -- today 00:00:00
3SELECT trunc(sysdate, 'Q') FROM DUAL;       -- 1rst quarter day
4SELECT trunc(sysdate, 'YEAR') FROM DUAL;    -- 1rst year day
5SELECT trunc(sysdate, 'MONTH') FROM DUAL;   -- 1rst month day
Monty
11 Jun 2020
1TRUNC function returns a date truncated
2to a specific unit of measure.
3TRUNC function returns a date truncated
4to a specific unit of measure.