The SQL TAN function calculates the tangent of an input argument.
In math, given the ABC triangle, the tan(A) is defined as the ratio between the side opposite to the A (a) and the side adjacent to the A (b) as follows:
tan A = a / bCode language: SQL (Structured Query Language) (sql)
For the inverse of the TAN function, see the ATAN function.
Syntax #
The following shows the syntax of the TAN function.
TAN(numeric_expression)Code language: SQL (Structured Query Language) (sql)Argument #
The TAN function accepts a numeric_expression that represents the angle in radians for which the tangent is calculated.
Return #
The TAN function returns a floating-point number.
Examples #
The following example returns the tangent 0:
SELECT
tan(0) result;Code language: SQL (Structured Query Language) (sql) result
--------
0Code language: SQL (Structured Query Language) (sql)Most database systems support the TAN function with the same behavior.
Was this tutorial helpful ?