oracle 取余/求积

前端之家收集整理的这篇文章主要介绍了oracle 取余/求积前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions112.htm

POWER

Syntax


Description of the illustration power.gif

Purpose

POWER@H_404_16@returnsn2@H_404_16@raised to then1@H_404_16@power. The basen2@H_404_16@and the exponentn1@H_404_16@can be any numbers,but ifn2@H_404_16@is negative,thenn1@H_404_16@must be an integer.

This function takes as arguments any numeric datatype or any nonnumeric datatype that can be implicitly converted to a numeric datatype. If any argument isBINARY_FLOAT@H_404_16@orBINARY_DOUBLE@H_404_16@,then the function returnsBINARY_DOUBLE@H_404_16@. Otherwise the function returnsNUMBER@H_404_16@.

See Also:

Table 2-10,"Implicit Type Conversion Matrix"for more information on implicit conversion

Examples

The following example returns 3 squared:

SELECT POWER(3,2) "Raised" FROM DUAL;

    Raised
----------
         9

https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions088.htm

MOD

Syntax


Description of the illustration mod.gif

Purpose

MOD@H_404_16@returns the remainder ofn2@H_404_16@divided byn1@H_404_16@. Returnsn2@H_404_16@ifn1@H_404_16@is 0.

This function takes as arguments any numeric datatype or any nonnumeric datatype that can be implicitly converted to a numeric datatype. Oracle determines the argument with the highest numeric precedence,implicitly converts the remaining arguments to that datatype,and returns that datatype.

See Also:

Table 2-10,"Implicit Type Conversion Matrix"for more information on implicit conversion and"Numeric Precedence"for information on numeric precedence

Examples

The following example returns the remainder of 11 divided by 4:

SELECT MOD(11,4) "Modulus" FROM DUAL;

   Modulus
----------
         3

猜你在找的Oracle相关文章