Basic Oracle Tutorial: single-row functions-numeric Functions

Source: Internet
Author: User
Numeric functions ROUNDTRUNCMODCEILpowerROUND (column name | expression, n) Rounding to the n-digit idlegt after the decimal point; selectround (458.734, 0), round (

Numeric functions round trunc mod ceil power ROUND (column name | expression, n) Rounding to the n-digit idlegt after the decimal point; select round (458.734, 0), round (

Numeric Functions
ROUND
TRUNC
MOD
CEIL
Power
ROUND (column name | expression, n)
Rounded to n digits after the decimal point
Idle> select round (458.734, 0), round (458.734, 1), round (458.734,-1) from dual;

ROUND (458.734, 0) ROUND (458.734, 1) ROUND (458.734,-1)
-------------------------------------------------
459 458.7 460

Idle>

TRUNC (column name | expression, n)
N digits after the decimal point
Idle> select trunc (458.734, 0), trunc (458.734, 1), trunc (458.734,-1) from dual


TRUNC (458.734, 0) TRUNC (458.734, 1) TRUNC (458.734,-1)
-------------------------------------------------
458 458.7 450

Idle>


MOD (m, n)
Returns the remainder of m divided by n.
Idle> select mod (10, 3) from dual;

MOD (10, 3)
----------
1

Idle>
Idle> select mod (3, 10) from dual;

MOD (3, 10)
----------
3

Idle>

CEIL rounded up to complement 1, opposite to trunc
Idle> select ceil (457.001) from dual; a decimal number is followed by one

CEIL (457.001)
-------------
458

Idle>


Power (base number, exponent) to power

SQL> select power (10, 3) from dual;

POWER (10, 3)
-----------
1000

SQL>

,

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.