Available in versions: Dev (3.21) | Latest (3.20) | 3.19 | 3.18 | 3.17 | 3.16 | 3.15 | 3.14 | 3.13 | 3.12 | 3.11

DEG

Supported by ✅ Open Source Edition   ✅ Express Edition   ✅ Professional Edition   ✅ Enterprise Edition

The DEG() function calculates the degrees from a radian value (see also RAD).

SELECT deg(3.14159265359);
create.select(deg(3.14159265359)).fetch();

The result being

+-----+
| deg |
+-----+
| 180 |
+-----+

Dialect support

This example using jOOQ:

deg(x)

Translates to the following dialect specific expressions:

Access

((x * 180) / 3.141592653589793)

ASE, Aurora MySQL, Aurora Postgres, ClickHouse, CockroachDB, DB2, Databricks, DuckDB, Exasol, H2, HSQLDB, Informix, MariaDB, MemSQL, MySQL, Postgres, Redshift, SQLDataWarehouse, SQLServer, SQLite, Snowflake, Sybase, Teradata, Trino, Vertica, YugabyteDB

degrees(x)

BigQuery

((CAST(x AS decimal) * 180) / acos(-1))

Firebird

((CAST(x AS numeric) * 180) / pi())

Hana, Spanner

((CAST(x AS numeric) * 180) / acos(-1))

Oracle

((CAST(x AS number) * 180) / acos(-1))
Generated with jOOQ 3.21. Support in older jOOQ versions may differ. Translate your own SQL on our website

Feedback

Do you have any feedback about this page? We'd love to hear it!

The jOOQ Logo