SQL Numeric functions in SAP HANA with examples and syntax

SQL Numeric functions in SAP HANA with examples and syntax:-

The SQL Numeric Function in SAP HANA contains something different then the SQL SERVER.Below all the SQL Numeric functions are explained one by one with examples and with syntax.

1.Syntax: ABS (n): This function is used to return the absolute value of the numeric argument n.

2.ACOS (n): This function is used to return the arc-cosine, in radians, of the numeric argument n between -1 and 1.

[AdSense-A]

3.ASIN (n): This function is used to return the arc-sine, in radians, of the numeric argument n between -1 and 1.

4.ATAN (n): This function is used to return the arc-tangent, in radians, of the numeric argument n. The range of n is unlimited.

5.ATAN2 (n, m): This function is used to return the arc-tangent, in radians, of the ratio of two numbers n and m. This produces the same result as ATAN(n/m).

6.BINTOHEX (expression): This function is used to convert a binary value to a hexadecimal value.

[AdSense-A]

7. BITAND (n, m): This function is used to perform an AND operation on the bits of the arguments n and m. Both n and m must be non-negative integers or varbinary. The BITAND function returns a result along argument’s type.

8.BITCOUNT (<expression>): This function is used to count the number of set bits of the argument <expression>. <expression> must be an integer or a varbinary. The BITCOUNT function returns an integer type.

9. BITNOT (expression): This function is used to perform a bitwise NOT operation on the bits of the argument <expression>. <expression>must be an integer. The BITNOT function returns a result along argument’s type.

10.BITOR (<expression1>, <expression2>): This function performs an OR operation on the bits of the arguments <expression1> and <expression2>. Both <expression1> and <expression2> must be non-negative integers or varbinary. The BITOR function returns a result along argument’s type.

11.BITSET (<target_num>, <start_bit>, <num_to_set>): This function is used to set <num_to_set> bits to 1 in <target_num> from the <start_bit> position.

12.BITUNSET (<target_num>, <start_bit>, <num_to_unset>): This function is used to set <num_to_unset> bits to 0 in <target_num> from the <start_bit> position.

11. BITXOR (expression1, expression2): This function is used to perform an XOR operation on the bits of the arguments <expression1> and <expression2>. Both <expression1> and <expression2> must be non-negative integers or varbinary. The BITXOR function returns a result along argument’s type.

12.CEIL (n): This function is used to return the first integer that is greater or equal to the value n.

13. COS (n): This function is used to return the cosine of the angle, in radians, of the argument n.

[AdSense-A]

14. COSH (n): This function is used to compute the hyperbolic cosine of the argument n.

15. COT (n):  This function is used to compute the cotangent of a number n, where the argument is an angle expressed in radians.

16. EXP (n): This function is used to return the result of the base of natural logarithms e raised to the power of the argument n.