The jOOQ User Manual. Multiple Pages : SQL building : Column expressions : Numeric functions | previous : next |
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 | 2.6
Numeric functions
Applies to ✅ Open Source Edition ✅ Express Edition ✅ Professional Edition ✅ Enterprise Edition
Math can be done efficiently in the database before returning results to your Java application. In addition to the arithmetic expressions discussed previously, jOOQ also supports a variety of numeric functions. As discussed in the chapter about SQL dialects numeric functions (as any function type) are mostly emulated in your database, in case they are not natively supported.
This is a list of numeric functions supported by jOOQ's Factory:
- ABS: Get the absolute value of a value.
- ACOS: Get the arc cosine of a value.
- ASIN: Get the arc sine of a value.
- ATAN: Get the arc tangent of a value.
- ATAN2: Get the atan2 function of two values.
- CEIL: Get the smalles integer value larger than a given numeric value.
- COS: Get the cosine of a value.
- COSH: Get the hyperbolic cosine of a value.
- COT: Get the cotangent of a value.
- COTH: Get the hyperbolic cotangent of a value.
- DEG: Transform radians into degrees.
- EXP: Calculate e^value.
- FLOOR: Get the largest integer value smaller than a given numeric value.
- GREATEST: Finds the greatest among all argument values (can also be used with non-numeric values).
- LEAST: Finds the least among all argument values (can also be used with non-numeric values).
- LN: Get the natural logarithm of a value.
- LOG: Get the logarithm of a value given a base.
- POWER: Calculate value^exponent.
- RAD: Transform degrees into radians.
- RAND: Get a random number.
- ROUND: Rounds a value to the nearest integer.
- SIGN: Get the sign of a value (-1, 0, 1).
- SIN: Get the sine of a value.
- SINH: Get the hyperbolic sine of a value.
- SQRT: Calculate the square root of a value.
- TAN: Get the tangent of a value.
- TANH: Get the hyperbolic tangent of a value.
- TRUNC: Truncate the decimals off a given value.
Please refer to the Factory Javadoc for more details.