Export (0) Print
Expand All

POWER

SQL Server 2000

Returns the value of the given expression to the specified power.

Syntax
POWER ( numeric_expression , y ) 
Arguments
numeric_expression
Is an expression of the exact numeric or approximate numeric data type categories, or types that are implicitly convertible to float.
y
Is the power to which to raise numeric_expression. y can be an expression of types that are implicitly convertible to float.
Return Types

Returns the same type as numeric_expression except for the following expressions.

Specified expression Return type
tinyint, smallint int
real/float float
Nonnumeric types that can be implicitly converted to float float
Examples

The following example raises the employee IDs in the Employees table in the Northwind database to the power of 3.

SELECT EmployeeID, POWER(EmployeeID, 3) AS Cube
FROM Employees
ORDER BY EmployeeID

This is the result set:

EmployeeID................Cube

--------------------------------

1................................1

2................................4

3................................9

4................................16

5................................25

6................................36

7................................49

8................................64

9................................81

Show:
© 2015 Microsoft