SQL Dialects Reference/Functions and expressions/Math functions/Trigonometric functions
From Wikibooks, the open-content textbooks collection
[edit] Trigonometric functions
This page includes comparison tables which can be big and complex.
While it's perfectly all right to view them in their complete state, it is recommended to install a comparison tables extension that would allow to select particular columns of interest for comparison.
| ANSI/ISO SQL Level | Feature-ID | Function | DB2 | SQLite | MySQL | PostgreSQL | Firebird[1] | OpenLink Virtuoso | Oracle | MSSQL | Linter |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Arc sine | ASIN(x) | N/A | ASIN(x) | ASIN(x) | ASIN(x) | ASIN(x) | ASIN(x) | ASIN(x) | ASIN(x) | ||
| Arc cosine | ACOS(x) | N/A | ACOS(x) | ACOS(x) | ACOS(x) | ACOS(x) | ACOS(x) | ACOS(x) | ACOS(x) | ||
| Arc tangent of x | ATAN(x) | N/A | ATAN(x) | ATAN(x) | ATAN(x) | ATAN(x) | ATAN(x) | ATAN(x) | ATAN(x) | ||
| Arc tangent of x and y | ATAN2(x, y) | N/A | ATAN2(x, y) ATAN(x, y) |
ATAN2(x,y) | ATAN2(x,y) | ATAN2(x, y) | ATAN2(x, y) | ATN2(x, y) | ATAN2(x, y) | ||
| Sine | SIN(x) | N/A | SIN(x) | SIN(x) | SIN(x) | SIN(x) | SIN(x) | SIN(x) | SIN(x) | ||
| Cosine | COS(x) | N/A | COS(x) | COS(x) | COS(x) | COS(x) | COS(x) | COS(x) | COS(x) | ||
| Tangent | TAN(x) | N/A | TAN(x) | TAN(x) | TAN(x) | TAN(x) | TAN(x) | TAN(x) | TAN(x) | ||
| Cotangent | COT(x) | N/A | COT(x) | COT(x) | COT(x) | COT(x) | N/A | COT(x) | N/A | ||
| Hyperbolic sine | SINH(x) | N/A | N/A | N/A | SINH(x) | N/A | SINH(x) | N/A | SINH(x) | ||
| Hyperbolic cosine | COSH(x) | N/A | N/A | N/A | COSH(x) | N/A | COSH(x) | N/A | COSH(x) | ||
| Hyperbolic tangent | TANH(x) | N/A | N/A | N/A | TANH(x) | N/A | TANH(x) | N/A | TANH(x) |
Notes:
- ↑ Firebird users need to register functions to make them available. The registration is done once for each database.