SQL Tutorial SQL Advanced SQL Database SQL References

Oracle TAN() Function



The Oracle (PL/SQL) TAN() function returns trigonometric tangent of an angle (angle should be in radians).

Syntax

TAN(x)

Parameters

x Required. Specify the angle in radian.

Return Value

Returns the trigonometric tangent of an angle.

Example 1:

The example below shows the usage of TAN() function.

TAN(0)
Result: 0

TAN(1)
Result: 1.55740772465490223050697480745836017308

TAN(-1)
Result: -1.55740772465490223050697480745836017308

TAN(2)
Result: -2.18503986326151899164330610231368254341

TAN(-2)
Result: 2.18503986326151899164330610231368254341

Example 2:

Consider a database table called Sample with the following records:

Datax
Data 1-10
Data 2-5
Data 30
Data 45
Data 510

The statement given below can be used to calculate the trigonometric tangent value of column x.

SELECT Sample.*, 
TAN(x) AS TAN_Value 
FROM Sample;

This will produce the result as shown below:

DataxTAN_Value
Data 1-10-.6483608274590866712591249330098086768202
Data 2-53.38051500624658563698270587944734390882
Data 300
Data 45-3.38051500624658563698270587944734390882
Data 510.6483608274590866712591249330098086768202

❮ Oracle Functions