Oracle Numeric processing function (absolute value, rounding ...) )

Source: Internet
Author: User
Tags abs square root

1. Absolute value: ABS ()

Select ABS ( -2) value from dual;

2. Rounding function (Large): Ceil ()

Select Ceil ( -2.001) value from dual; (-2)

3. Rounding function (small): Floor ()

Select Floor ( -2.001) value from dual; (-3)

4. Rounding function (intercept): Trunc ()

Select Trunc ( -2.001) value from dual; (-2)

5. Rounding: Round ()

Select round (1.234564) value from dual; (1.2346)

6. Take square: Power (m,n)

Select Power (4,2) value from dual; (16)

7. Take the square root: SQRT ()

Select sqrt (+) value from dual; (4)

8. Take random number: Dbms_random (minvalue,maxvalue)

Select Sys.dbms.random.value (0,1) value from dual;

9. Take symbol: sign ()

Select sign ( -3) value from dual; (-)

10, fetch the maximum value of the collection: Greatest (Value)

Select Greatest ( -1,3,5,7,9) value from dual; (9)

11. Take the minimum value of the collection: least (value)

Select Least ( -1,3,5,7,9) value from dual; (-1)

12. Handling Null values: NVL (null value, instead of value)

Select NVL (null,10) value from dual; (10)

13. Character sequence: ASCII ()

Select ASCII (a) value from dual;

14. Ordinal character: Chr ()

Select CHR value from dual;

15. Link: concat ()

Select Concat ("One", "a") value from dual; (1122)

16. Get system Time: Sysdate ()

Select Sysdate value from dual;

17. Date of request

Select Trunc (sysdate) from dual;

18. Ask for Time

Select To_char (sysdate, "Hh24:mm:ss") from dual;

19. First Letter Capital: Initcap ()

Select Initcap (ABC def GHI) value from dual; (ABC def GHI)

Oracle Numeric processing function (absolute value, rounding ...) )

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.