| Function | Description | SYNTAX | Example |
|---|---|---|---|
| ABS | ABS ( { int | long | decimal | double } ) | ||
| ACOS | ACOS(double) | ||
| ASIN | ASIN(double) | ||
| ATAN | ATAN(double) | ||
| COS | COS(double) | ||
| COT | COT(double) | ||
| SIN | SIN(double) | ||
| TAN | TAN(double) | ||
| ATAN2 | ATAN2(double, double) | ||
| BITAND | The bitwise AND operation. | BITAND(long, long) | |
| BITOR | The bitwise OR operation. | BITOR(long, long) | |
| BITXOR | The bitwise XOR operation. | BITXOR(long, long) | |
| MOD | The modulo operation. | MOD(long, long) | |
| CEILING | CEILING(double) | ||
| DEGREES | DEGREES(double) | ||
| EXP | EXP(double) | ||
| FLOOR | FLOOR(double) | ||
| LOG | LOG(double) | ||
| LOG10 | LOG10(double) | ||
| RADIANS | RADIANS(double) | ||
| SQRT | SQRT(double) | ||
| PI | PI() | ||
| POWER | POWER(double, double) | ||
| RAND | Calling the function without parameter returns the next a pseudo random number. | RAND( [ int ] ) | |
| RANDOM_UUID | Returns a new UUID with 122 pseudo random bits. | RANDOM_UUID() | |
| ROUND | Rounds to a number of digits. | ROUND(double, digitsInt) | |
| ROUNDMAGIC | This function rounds numbers in a good way, but it is slow. | ROUNDMAGIC(double) | |
| SECURE_RAND | Generates a number of cryptographically secure random numbers. | SECURE_RAND(int) | |
| SIGN | Returns -1 if the value is smaller 0, 0 if zero, and otherwise 1. | SIGN ( { int | long | decimal | double } ) | |
| ENCRYPT | Encrypts data using a key. | ENCRYPT(algorithmString, keyBytes, dataBytes) | |
| DECRYPT | Decrypts data using a key. | DECRYPT(algorithmString, keyBytes, dataBytes) | |
| HASH | Calculate the hash value using an algorithm, and repeat this process for a number of iterations. | HASH(algorithmString, dataBytes, iterationInt) | |
| TRUNCATE | Truncates to a number of digits (to the next value closer to 0). | TRUNCATE(double, digitsInt) | |
| COMPRESS | Compresses the data using the specified compression algorithm. | COMPRESS(dataBytes [, algorithmString]) | |
| EXPAND | Expands data that was compressed using the COMPRESS function. | EXPAND(bytes) | |
| ZERO | Returns the value 0. | ZERO() |
Pages
▼
SQL basics- complete reference guide - part5 - Mathematical Functions
Part5: Mathematical Functions in SQL- Complete Reference
No comments:
Post a Comment
Your Comment and Question will help to make this blog better...