TAN

From SQLZOO
Revision as of 09:54, 16 July 2012 by Connor (Talk | contribs) (Created page with "<table align='right' border='1'> <caption>Compatibility</caption> <tr><th colspan='3'>TAN(s1 IN s2)</th></tr> <tr><td align='center'>'''Engine'''</td><td align='center'>'''OK'...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Compatibility
TAN(s1 IN s2)
EngineOKAlternative
ingresYes
mysqlYes
oracleYes
postgresYes
sqlserverYes

TAN

TAN(f) returns the tangent of f where f is in radians.

  TAN(3.14159/4) -> 1   
schema:scott
 DROP TABLE angle
 CREATE TABLE angle(
  id INTEGER,
  angle FLOAT);
INSERT INTO angle VALUES (0,1);
INSERT INTO angle VALUES (1,0.7853);
INSERT INTO angle VALUES (2,0.5235);
INSERT INTO angle VALUES (3,1.0471);

In this example you return the tangent of each of the angles.

SELECT id, angle, TAN(angle)
FROM angle

See also