MySQL functions-other functions, mysql Functions
IF (expr, v1, v2) expr expression is true, v1 is returned; otherwise, v2 is returned.
IFNULL (v1, v2) If v1 is NULL, v2 is returned. If v1 is not NULL, v1 is returned.
CASE expr WHEN v1 THEN r1 [WHEN v2 THEN r2] [...] [ELSE m] END
If expr is equal to the value in v1.v2..., return r1, r2. After THEN. Otherwise, return the value m after ELSE.
Case when v1 THEN r1 [WHEN v2 THEN r2] [...] [ELSE m] END
If a value in v1, v2... is true, the value after THEN is returned. Otherwise, the value after ELSE is returned.
VERSION () returns the MySql VERSION.
CONNECTION_ID () returns the current Mysql connection count
Show processlist; show full processlist; display the running thread
DATEBASE (), SCHEMA () returns the current database
USER (), CURRENT_USER (), SYSTEM_USER (), SESSION_USER () returns the current USER name
CHARSET (str) returns the str Character Set
COLLATION (str) returns the str character Arrangement
LAST_INSERT_ID () returns the id value generated at the end of AUTO_INCREMENT. If you insert data in batches, the first
Encryption-MD5 (str) returns str MD5 encryption 32-bit hexadecimal
Encrypted ENCODE (str, pwd_str) uses pwd_str as the password to encrypt str, a binary string with the same length as str
Decrypts DECODE ('str', pwd_str) and decrypts pwd_str as a password, which is an inverse function of the preceding ENCODE ().
FORMAT (x, n) FORMAT the number x, retain n as the decimal number, and return it as a string
CONV (N, from_base, to_base) converts N from from_base to to_base.
BENCHMARK (count, expr) repeated expr execution total count
CONVERT (str USING charset) converts str to the corresponding charset
CAST (x AS type), CONVERT (x, type) returns the value of converting x to type