Oracle functions finishing <slowly finishing>

Oracle commonly used functions

1, mathematical functions:

◆ round (n, [m] ) This function is used to perform rounding, if m omitted, then rounded to the nearest integer; if m is a positive number, m is rounded to the decimal point if m is negative, rounded to the decimal point. before the m-bit
123.456 round (123.456, 2) = 123.46
◆ the trunc (n-, [m]) for intercepting the function number. If m omitted, it is truncated fractional part, m is a positive number if it is taken into decimal points m after, if m is negative, then taken to the front of the decimal point m
123.456 trunc (123.456, 1) = 123.4
supplementary: the trunc (DATE, [FMT])
SELECT the trunc (SYSDATE, 'YYYY') from Dual; - then return the first day.
SELECT the trunc (SYSDATE, 'the MM') from Dual; -. returns the first of the month
select trunc (sysdate, 'D' ) from dual; -. returns the first day of the current week
◆ mod (m , n) modulo modulo
◆ floor (n) returns the largest integer less than or equal to n, rounded down
123.456 Floor (123.456) = 123
◆ ceil (n) returns the n is greater than or equal to the smallest integer rounded up
123.456 ceil (123.456) = 123

ABS (n) Returns the absolute value of n
SELECT ABS (-13) from Dual;
ACOS (n): Returns the inverse value Cosine
asin (n): Returns the value of the arc-rotating
atan (n): Returns the arctangent
COS (n)
exp (n): returns the n-th power of e
log (m, n) returns the value of the
n-th power of m returns: power (m, n)

 

2、

trunc function: function is not taken when rounding, direct interception.
For case numbers, such as:
SELECT the trunc (123.458) from --123 Dual
SELECT the trunc (123.458,0) from --123 Dual
SELECT the trunc (123.458,1) from Dual --123.4
SELECT the trunc (123.458, -1) from --120 Dual
SELECT the trunc (123.458, -4) from Dual --0
SELECT the trunc (123.458,4) from Dual --123.458
SELECT the trunc (123) from --123 Dual
SELECT the trunc (123,1) from Dual - 123
SELECT the trunc (123, -1) from Dual --120

Date for the case, such as:
the SELECT trunc (sysdate) from Dual --2 017/6/13 return to today's date
select trunc (sysdate, 'yyyy' ) from dual --2017 / 1/1 returns the first day of the year.
The SELECT trunc (sysdate, 'mm') from dual --2017 / 6/1 return to the first day of the month.
SELECT the trunc (SYSDATE, 'D') from Dual --2 017 /. 6 /. 11 returns the current week on the first day (in Sunday is the first day).
SELECT the trunc (SYSDATE, 'dd') from Dual --2,017 /. 6/13 is to return the current date
select trunc (sysdate, 'hh' ) from dual --2017 / 6/13 13 : 00: 00 The current hour
select trunc (sysdate, 'mi' ) from dual --2017 / 6/13 13:06:00 returns the current minute

Guess you like

Origin www.cnblogs.com/dh64319399/p/oracle_fun.html