Hitachi

Hitachi Advanced Database SQL Reference


8.2.7 DEGREES

Returns the result of converting the specified angle from radians to degrees.

Organization of this subsection

(1) Specification format

scalar-function-DEGREES ::= DEGREES(angle)
 
  angle ::= value-expression

(2) Explanation of specification format

angle:

Specifies the angle in radians.

The following rules apply:

(3) Rules

  1. The data type of the execution result is the DOUBLE PRECISION type.

  2. If the execution result cannot be represented in the DOUBLE PRECISION type, an overflow error is generated.

  3. The NOT NULL constraint does not apply to the value of the execution result (the null value is allowed).

  4. If the angle has a null value, the execution result will be a null value.

(4) Examples

Example 1:

Convert [Figure] to degrees.

SELECT DEGREES(PI()) FROM "T1"

[Figure]

Example 2:

With the values of columns C1 and C2 from table T1 as input, use the scalar function ATAN2 to determine the inverse tangent of the angle (in radians), and then use the scalar function DEGREES to convert it to degrees.

SELECT DEGREES(ATAN2("C1","C2")) FROM "T1"

[Figure]