T-SQL Numeric functionIn T-SQL, a Numeric function is applied to numeric data and returns digital data. The types of Numeric function are given below:
The absolute value is returned as the output of the numeric expression. Example The query returns the absolute value.
The arc cosine value is returned as the output of the numeric expression that is specified. Example The below code generates the arc cosine value of 0.
Arc sine value is returned as the output of the specific numeric value expression. Example The query gives the arc sine value of 0.
The arc tangent value is returned as the output of the specific numeric expression. Examples: The query returns an arc tangent value 0
The Arc tangent value in all the four quadrants comes as the output for the specified expression. Example: The below query gives the arc tangent value in the four quadrants of 0. See the EMPLOYEES table, which has these records.
If the value exists between the two expressions, then the below output will come. Where salary is between 20000 and 85000. Output:
The minimum value will occur as the output from the given expression. Example: The query gives '15000.00' for the 'salary' expression from the Employee table.
The maximum value is returned as the output of the expression. Example: The below code will give '20000.00' for the 'salary' expression from the customer's table.
The square root of the numeric expression is returned as the output. Example It gives 2 for the 4 numeric expressions.
The PI() function generates the numeric output. Example: The below query gives 3.14159265358979 for the PI value.
The CEILING () function returns the output after rounding of the decimals, which is the next highest value of the table. Example: The query gives 235 for the given 234.25 value.
The function generates the output after rounding of the decimals, which is equal to or less than the expression value. Example: The query gives 231 for the given 231.34 value.
The natural logarithm of the expression is returned as the output. Example: The below query will give 0 for the given one value. Next TopicSQL vs. PL/SQL vs. T-SQL |