Oracle mathematical functions
This article summarizes Oracle mathematical functions. We will share this with you for your reference. The details are as follows:
1. Absolute Value: abs ()
select abs(-2) value from dual;
2. Take the entire function (large): ceil ()
select ceil(-2.001) value from dual;(-2)
3. Take the entire function (small): floor ()
select floor(-2.001) value from dual;(-3)
4. Take the entire function (screenshot): trunc ()
select trunc(-2.001) value from dual; (-2)
5. Rounding: round ()
select round(1.234564) value from dual;(1.2346)
6. Square: Power (m, n)
select power(4,2) value from dual;(16)
7. Take the square root: SQRT ()
select sqrt(16) value from dual;(4)
8. Random Number: dbms_random (minvalue, maxvalue)
select sys.dbms.random.value(0,1) value from dual;
9. Sign: Sign ()
select sign(-3) value from dual;(-)
10, take the maximum value of the set: greatest (value)
select greatest(-1,3,5,7,9) value from dual;(9)
11. Take the minimum value of the set: least (value)
select least(-1,3,5,7,9) value from dual;(-1)
12. process Null values: nvl (Null value, instead of value)
select nvl(null,10) value from dual;(10)
13. Search for the character serial number: ascii ()
select ascii(a) value from dual;
14. ordinal character: chr ()
select chr(97) value from dual;
15. Link: concat ()
select concat("11","22") value from dual;(1122)
16. Obtain the system time: sysdate ()
select sysdate value from dual;
17. Calculate the date
select trunc(sysdate) from dual;
18. Time
select to_char(sysdate,"hh24:mm:ss") from dual;
19. uppercase letters: InitCAP ()
select INITCAP(abc def ghi) value from dual;(Abc Def Ghi)
I hope this article will help you with Oracle database programming.
Articles you may be interested in:
- Oracle functions [string functions, mathematical functions, date functions]
- Oracle Text Functions
- Oracle System Variable Function Usage Guide
- How to use Oracle to_char Functions
- Differences between Oracle processes and functions
- Introduction to oracle trim Functions
- Oracle to_date () function usage
- Oracle-defined DES encryption and decryption and MD5 encryption function example
- Introduction to oracle nvl Functions
- Detailed description of Oracle ranking function (Rank) Instances