加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

oracle 取余/求积

发布时间:2020-12-12 14:37:00 所属栏目:百科 来源:网络整理
导读:https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions112.htm POWER Syntax Description of the illustration power.gif Purpose POWER returns n2 raised to the n1 power. The base n2 and the exponent n1 can be any numbers,but if n2 is

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读