SQL Server 2008 Mathematical Functions

In this article I will explain about the mathematical functions in SQL Server.
  • 2570

Introduction

Mathematical Functions are used to perform calculations, that are provided as an argument in input values. After performing calculation they return numeric values as result.

Following are the built-in mathematical functions.

1. ABS (n)

It returns the absolute value of the specified numeric expression.

ABS_function_in_SQL.jpg
 

2. CEILING (n)

It returns the smallest integer grater than, or equal to the input numeric expression.

CEILING_Function-in-sql.jpg
 

3. FLOOR (n)

It returns the greatest integer less than or equal to the input numeric expression.

FLOOR_Function-in-sql.jpg
 

4. LOG (n)

It returns the natural logarithm with base-e of specified numeric expression.

LOG_Function-in-sql.jpg
 

5. LOG10 (n)

It returns the base-10 logarithm of the specified numeric expression.

LOG10-function-in-sql.jpg
 

6. PI ()

It returns the constant value of PI.

PI_function-in-sql.jpg
 

7. POWER (x, y)

Calculates the value of a specified expression x to a specified power y.

POWER-function-in-sql.jpg
 

8. SQUARE (n)

It returns the square of specified numeric expression.

SQUARE-function-in-sql.jpg


Categories

More Articles

© 2019 DotNetHeaven. All rights reserved.