Επεξεργασία

Κοινή χρήση μέσω


POWER (NoSQL query)

APPLIES TO: NoSQL

Returns the value of the specified expression multipled by itself the given number of times.

Syntax

POWER(<numeric_expr_1>, <numeric_expr_2>)  

Arguments

Description
numeric_expr_1 A numeric expression.
numeric_expr_2 A numeric expression indicating the power to raise numeric_expr_1.

Return types

Returns a numeric expression.

Examples

The following example demonstrates raising a number to various powers.

SELECT VALUE {
    oneFirstPower: POWER(1, 1),
    twoSquared: POWER(2, 2),
    threeCubed: POWER(3, 3),
    fourFourthPower: POWER(4, 4),
    fiveFithPower: POWER(5, 5),
    zeroSquared: POWER(0, 2),
    nullCubed: POWER(null, 3),
    twoNullPower: POWER(2, null)
}
[
  {
    "oneFirstPower": 1,
    "twoSquared": 4,
    "threeCubed": 27,
    "fourFourthPower": 256,
    "fiveFithPower": 3125,
    "zeroSquared": 0
  }
]

Remarks

  • This function doesn't use the index.