Search code examples
derby

Is there an equivalent of extract method of MySQL in Apache Derby?


Is there an equivalent of extract method of MySQL in Apache Derby? Or doesn't Derby support it?


Solution

  • Derby does not have an exact equivalent of extract.

    It has:

    But you can always write your own functions:

    CREATE FUNCTION TO_DEGREES(RADIANS DOUBLE) RETURNS DOUBLE
    PARAMETER STYLE JAVA NO SQL LANGUAGE JAVA
    EXTERNAL NAME 'java.lang.Math.toDegrees'
    

    See also: