https://randomsrsolutions.blogspot.com/2018/05/using-trunc-function-with-numbers-in.html
The TRUNC function Truncates the Column, Expression or Value to n Decimal Places.
The TRUNC Function Works with arguments similar to those of the Round Function. If the Second argument is 0 or is missing , the value is truncated to Zero decimal places. If the second argument is 2, the value is truncated to two decimal places. Conversely, if the second argument is -2 the value is truncated to two decimal places to the left.
Like the Round Function, the TRUNC function can be used with Date functions
select
Trunc(5.9283),
Trunc(5.9283,0),
Trunc(5.9283,1),
Trunc(5.9283,2),
Trunc(5.9283,3)
from dual;
Trunc(5.9283) Trunc(5.9283,0) Trunc(5.9283,1) Trunc(5.9283,2) Trunc(5.9283,3)
5 5 5.9 5.92 5.928
select
Trunc(3.5397),
Trunc(3.5397,0),
Trunc(3.5397,1),
Trunc(3.5397,2),
Trunc(3.5397,3)
from dual;
Trunc(3.5397) Trunc(3.5397,0) Trunc(3.5397,1) Trunc(3.5397,2) Trunc(3.5397,3)
3 3 3.5 3.53 3.539
-----------------------------------------------------------------------------------------------
Trunc with -ve Decimal Request
select
Trunc(5675.9283,-1),
Trunc(5675.9283,-2),
Trunc(5675.9283,-3),
Trunc(5675.9283,-4)
from dual;
Trunc(5675.9283,-1) Trunc(5675.9283,-2) Trunc(5675.9283,-3) Trunc(5675.9283,-4)
5670 5600 5000 0
Subscribe to:
Post Comments (Atom)
XLA to GL Link
https://plsqlquery.blogspot.com/2025/12/xla-to-gl-link.html SELECT acr.cash_receipt_id, acr.receipt_number, ...
-
https://plsqlquery.blogspot.com/2018/05/using-outer-joins-in-plsql-query.html We use Outer Join when mismatched Values to be displayed ...
-
https://plsqlquery.blogspot.com/2018/05/using-trim-in-plsql-query.html The Oracle/PLSQL TRIM function removes all specified characters eit...
-
https://randomsrsolutions.blogspot.com/2018/05/using-trunc-function-with-numbers-in.html The TRUNC function Truncates the Column, Expressi...
No comments:
Post a Comment