New versions: Dev (3.14) | Latest (3.13) | 3.12 | 3.11 | 3.10 | 3.9 | 3.8 | Old versions: 3.7 | 3.6 | 3.5 | 3.4 | 3.3

DEG

Applies to ✅ 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(3.14159265359)

Translates to the following dialect specific expressions:

-- ACCESS
((3.14159265359 * 180) / 3.141592653589793)

-- ASE, AURORA_MYSQL, AURORA_POSTGRES, COCKROACHDB, CUBRID, DB2, DERBY, H2, HSQLDB, INFORMIX, MARIADB, MEMSQL, MYSQL, 
-- POSTGRES, REDSHIFT, SQLDATAWAREHOUSE, SQLSERVER, SYBASE, TERADATA, VERTICA
degrees(3.14159265359)

-- FIREBIRD
((CAST(3.14159265359 AS numeric) * 180) / pi())

-- HANA
((CAST(3.14159265359 AS numeric) * 180) / (asin(1) * 2))

-- INGRES
((CAST(3.14159265359 AS decimal(38, 19)) * 180) / pi())

-- ORACLE
((CAST(3.14159265359 AS number) * 180) / (asin(1) * 2))

-- SQLITE
((CAST(3.14159265359 AS numeric) * 180) / 3.141592653589793)

(These are currently generated with jOOQ 3.14, see #10141)

The jOOQ Logo