SQLite Tutorial SQLite Advanced SQLite Database SQLite References

SQLite DEGREES() Function



The SQLite DEGREES() function returns an angle measured in radians to an approx. equivalent angle measured in degrees.

Syntax

DEGREES(x)

Parameters

x Required. Specify an angle in radians.

Return Value

Returns the angle measured in degrees.

Example 1:

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

SELECT DEGREES(0);
Result: 0.0

SELECT DEGREES(1);
Result: 57.2957795130823

SELECT DEGREES(2);
Result: 114.591559026165

SELECT DEGREES(3);
Result: 171.887338539247

SELECT DEGREES(PI()/3);
Result: 60.0

SELECT DEGREES(PI()/2);
Result: 90.0

SELECT DEGREES(PI());
Result: 180.0

Example 2:

Consider a database table called Sample with the following records:

Datax
Data 10
Data 21
Data 32
Data 43
Data 54

The statement given below can be used to convert the records of column x (containing values expressed in radians) into degrees.

SELECT *, DEGREES(x) AS DEGREES_Value FROM Sample;

This will produce the result as shown below:

DataxDEGREES_Value
Data 100.0
Data 2157.2957795130823
Data 32114.591559026165
Data 43171.887338539247
Data 54229.183118052329

❮ SQLite Functions