微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

oracle 取余/求积

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

POWER

Syntax


Description of the illustration power.gif

Purpose

POWERreturnsn2raised to then1power. The basen2and the exponentn1can be any numbers,but ifn2is negative,thenn1must 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_FLOATorBINARY_DOUBLE,then the function returnsBINARY_DOUBLE. Otherwise the function returnsNUMBER.

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

MODreturns the remainder ofn2divided byn1. Returnsn2ifn1is 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

原文地址:https://www.jb51.cc/oracle/208197.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐