The DECODE() function decodes a "Binary string" with "password".
As a result, a character string that was previously encrypted is returned.
Numeric values in the "Password" argument are interpreted as a character string.
If "Binary string" contains no characters, an empty string is returned.
If the value of the "Binary string" or "Password" argument is NULL, the DECODE() function returns NULL.
To encode a character string, the ENCODE() function can be chosen.
Starting with MariaDB version 10.3.2, when Oracle mode is enabled, this function works like the DECODE_ORACLE() function.
This feature is not present in MySQL 8.0. |