Tuesday, February 24, 2015

Nitheen Kumar

SQL Server Mathematical Functions

 
SQL Server Mathematical Functions

The following scalar math functions perform a calculation, usually based on input values that are provided as arguments, and return a numeric value.  All mathematical functions, except for RAND, are deterministic functions.  This means they return the same results each time they are called with a specific set of input values.  The RAND function is only deterministic when a seed parameter is specified.

Arithmetic functions, such as ABS, CEILING, DEGREES, FLOOR, POWER, RADIANS, and SIGN, return a value having the same data type as the input value.  Trigonometric and other functions, including EXP, LOG, LOG10, SQUARE, and SQRT, cast their input values to float and return a float value.

FunctionDescription
ABSA mathematical function that returns the absolute (positive) value of the specified numeric expression.
Syntax:
ABS ( numeric_expression )
ACOSA mathematical function that returns the angle, in radians, whose cosine is the specified float expression; also called arccosine.
Syntax:
ACOS ( float_expression )
ASINReturns the angle, in radians, whose sine is the specified float expression. This is also called arcsine.
Syntax:
ASIN ( float_expression )
ATANReturns the angle in radians whose tangent is a specified float expression. This is also called arctangent.
Syntax:
ATAN ( float_expression )
ATN2Returns the angle, in radians, between the positive x-axis and the ray from the origin to the point (y, x), where x and y are the values of the two specified float expressions.
Syntax:
ATN2 ( float_expression, float_expression )
CEILINGReturns the smallest integer greater than, or equal to, the specified numeric expression.
Syntax:
CEILING ( numeric_expression )
COSIs a mathematical function that returns the trigonometric cosine of the specified angle, in radians, in the specified expression.
Syntax:
COS ( float_expression )
COTA mathematical function that returns the trigonometric cotangent of the specified angle, in radians, in the specified float expression.
Syntax:
COT ( float_expression )
DEGREESReturns the corresponding angle in degrees for an angle specified in radians.
Syntax:
DEGREES ( numeric_expression )
EXPReturns the exponential value of the specified float expression.
Syntax:
EXP ( float_expression )
FLOORReturns the largest integer less than or equal to the specified numeric expression.
Syntax:
FLOOR ( numeric_expression )
LOGReturns the natural logarithm of the specified float expression.
Syntax:
LOG ( float_expression )
LOG10Returns the base-10 logarithm of the specified float expression.
Syntax:
LOG10 ( float_expression )
PIReturns the constant value of PI.
Syntax:
PI ()
POWERReturns the value of the specified expression to the specified power.
Syntax:
POWER ( float_expression, y )
RADIANSReturns radians when a numeric expression, in degrees, is entered.
Syntax:
RADIANS ( numeric_expression )
RANDReturns a pseudo-random float value from 0 through 1, exclusive.
Syntax:
RAND ( [ seed ] )
ROUNDReturns a numeric value, rounded to the specified length or precision.
Syntax:
ROUND ( numeric_expression, length [ , function ] )
SIGNReturns the positive (+1), zero (0), or negative (-1) sign of the specified expression.
Syntax:
SIGN ( numeric_expression )
SINReturns the trigonometric sine of the specified angle, in radians, and in an approximate numeric, float, expression.
Syntax:
SIN ( float_expression )
SQRTReturns the square root of the specified float value.
Syntax:
SQRT ( float_expression )
SQUAREReturns the square of the specified float value.
Syntax:
SQUARE ( float_expression )
TANReturns the tangent of the input expression.
Syntax:
TAN ( float_expression )
Subscribe to get more Posts :