8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

正文为中文,英文原文默认隐藏。点击任意中文段落即可展开 / 收起对应英文原文。

打开官方英文原文 ↗

译文由机器翻译生成,仅供理解参考;有疑问请以官方英文原文为准。

MySQL 8.4 参考手册 / 14 函数和运算符 / 14.1 内置函数和运算符参考
中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 55%

14.1 内置函数和运算符参考14.1 Built-In Function and Operator Reference

下表列出了每个内置(本地)函数和运算符,并提供了每个函数的简要说明。有关在运行时可加载函数的列表,请参见 第 14.2 节,“可加载函数参考”。The following table lists each built-in (native) function and operator and provides a short description of each one. For a table listing functions that are loadable at runtime, see Section 14.2, “Loadable Function Reference”.

表 14.1 内置函数和运算符Table 14.1 Built-In Functions and Operators

名称Name 说明Description 已弃用Deprecated
&& 按位与Bitwise AND
>> 大于运算符Greater than operator
>>>> 右移Right shift
>=>= 大于或等于运算符Greater than or equal operator
<< 小于运算符Less than operator
<>, !=<>, != 不等于运算符Not equal operator
<<<< 左移Left shift
<= 小于或等于运算符Less than or equal operator
<=> NULL 安全等于运算符NULL-safe equal to operator
%, MOD 取模运算符Modulo operator
* 乘法运算符Multiplication operator
+ 加法运算符Addition operator
- 减法运算符Minus operator
- 改变参数的符号Change the sign of the argument
-> 在评估路径后从 JSON 列返回值;等同于 JSON_EXTRACT()。Return value from JSON column after evaluating path; equivalent to JSON_EXTRACT().
->> 在评估路径并去掉结果引号后从 JSON 列返回值;等同于 JSON_UNQUOTE(JSON_EXTRACT())。Return value from JSON column after evaluating path and unquoting the result; equivalent to JSON_UNQUOTE(JSON_EXTRACT()).
/ 除法运算符Division operator
:= 赋值一个值Assign a value
= 分配一个值(作为 SET 语句的一部分,或作为 UPDATE 语句中 SET 子句的一部分)Assign a value (as part of a SET statement, or as part of the SET clause in an UPDATE statement)
= 等于运算符Equal operator
^ 按位异或Bitwise XOR
ABS() 返回绝对值Return the absolute value
ACOS() 返回反余弦Return the arc cosine
ADDDATE() 将时间值(间隔)添加到日期值Add time values (intervals) to a date value
ADDTIME() 添加时间Add time
AES_DECRYPT() 使用 AES 解密Decrypt using AES
AES_ENCRYPT() 使用 AES 加密Encrypt using AES
AND, && 逻辑与Logical AND
ANY_VALUE() 仅抑制 ONLY_FULL_GROUP_BY 值拒绝Suppress ONLY_FULL_GROUP_BY value rejection
ASCII() 返回最左边字符的数值Return numeric value of left-most character
ASIN() 返回反正弦Return the arc sine
asynchronous_connection_failover_add_managed() 将组成员源服务器配置信息添加到复制通道源列表Add group member source server configuration information to a replication channel source list
asynchronous_connection_failover_add_source() 将源服务器配置信息服务器添加到复制通道源列表Add source server configuration information server to a replication channel source list
asynchronous_connection_failover_delete_managed() 从复制通道源列表中移除托管组Remove a managed group from a replication channel source list
asynchronous_connection_failover_delete_source() 从复制通道源列表中移除源服务器Remove a source server from a replication channel source list
asynchronous_connection_failover_reset() 删除所有与组复制异步故障切换相关的设置Remove all settings relating to group replication asynchronous failover
ATAN() 返回反正切Return the arc tangent
ATAN2(), ATAN() 返回两个参数的反正切Return the arc tangent of the two arguments
AVG() 返回参数的平均值Return the average value of the argument
BENCHMARK() 重复执行一个表达式Repeatedly execute an expression
BETWEEN ... AND ... 一个值是否在某一数值范围内Whether a value is within a range of values
BIN() 返回包含数字二进制表示的字符串Return a string containing binary representation of a number
BIN_TO_UUID() 将二进制 UUID 转换为字符串Convert binary UUID to string
BINARYBINARY 将字符串转换为二进制字符串Cast a string to a binary string 是Yes
BIT_AND() 返回按位与Return bitwise AND
BIT_COUNT() 返回被设置的位数Return the number of bits that are set
BIT_LENGTH() 返回参数的位长度Return length of argument in bits
BIT_OR() 返回按位或Return bitwise OR
BIT_XOR() 返回按位异或Return bitwise XOR
CAN_ACCESS_COLUMN() 内部使用仅Internal use only
CAN_ACCESS_DATABASE() 内部使用仅Internal use only
CAN_ACCESS_TABLE() 内部使用仅Internal use only
CAN_ACCESS_USER() 内部使用仅Internal use only
CAN_ACCESS_VIEW() 内部使用仅Internal use only
CASE 案例操作符Case operator
CAST() 将值转换为某种类型Cast a value as a certain type
CEIL() 返回不小于参数的最小整数值Return the smallest integer value not less than the argument
CEILING() 返回不小于参数的最小整数值Return the smallest integer value not less than the argument
CHAR() 返回传入的每个整数对应的字符Return the character for each integer passed
CHAR_LENGTH() 返回参数中的字符数Return number of characters in argument
CHARACTER_LENGTH() CHAR_LENGTH() 的同义词Synonym for CHAR_LENGTH()
CHARSET() 返回参数的字符集Return the character set of the argument
COALESCE() 返回第一个非空参数Return the first non-NULL argument
COERCIBILITY() 返回字符串参数的排序规则强制值Return the collation coercibility value of the string argument
COLLATION() 返回字符串参数的排序规则Return the collation of the string argument
COMPRESS()COMPRESS() 将结果作为二进制字符串返回Return result as a binary string
CONCAT() 返回连接的字符串Return concatenated string
CONCAT_WS() 返回带分隔符的连接Return concatenate with separator
CONNECTION_ID() 返回连接的连接 ID(线程 ID)Return the connection ID (thread ID) for the connection
CONV() 在不同的数字进制之间转换数字Convert numbers between different number bases
CONVERT() 将值转换为某种类型Cast a value as a certain type
CONVERT_TZ() 将一个时区转换为另一个时区Convert from one time zone to another
COS() 返回余弦值Return the cosine
COT() 返回余切Return the cotangent
COUNT() 返回返回的行数Return a count of the number of rows returned
COUNT(DISTINCT) 返回不同值的数量Return the count of a number of different values
CRC32() 计算循环冗余校验值Compute a cyclic redundancy check value
CUME_DIST() 累计分布值Cumulative distribution value
CURDATE() 返回当前日期Return the current date
CURRENT_DATE(), CURRENT_DATE CURDATE() 的同义词Synonyms for CURDATE()
CURRENT_ROLE() 返回当前的活跃角色Return the current active roles
CURRENT_TIME(), CURRENT_TIME CURTIME() 的同义词Synonyms for CURTIME()
CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP NOW() 的同义词Synonyms for NOW()
CURRENT_USER(), CURRENT_USER 经过身份验证的用户名和主机名The authenticated user name and host name
CURTIME() 返回当前时间Return the current time
DATABASE() 返回默认(当前)数据库名称Return the default (current) database name
DATE() 提取日期或日期时间表达式中的日期部分Extract the date part of a date or datetime expression
DATE_ADD() 将时间值(间隔)添加到日期值Add time values (intervals) to a date value
DATE_FORMAT() 按指定格式显示日期Format date as specified
DATE_SUB() 从日期中减去时间值(间隔)Subtract a time value (interval) from a date
DATEDIFF() 相减两个日期Subtract two dates
DAY() DAYOFMONTH() 的同义词Synonym for DAYOFMONTH()
DAYNAME() 返回星期几的名称Return the name of the weekday
DAYOFMONTH() 返回月份中的日期(0-31)Return the day of the month (0-31)
DAYOFWEEK() 返回参数的星期索引Return the weekday index of the argument
DAYOFYEAR() 返回一年中的第几天(1-366)Return the day of the year (1-366)
DEFAULT() 返回表列的默认值Return the default value for a table column
DEGREES() 将弧度转换为度Convert radians to degrees
DENSE_RANK() 当前行在其分区内的排名,无间隙Rank of current row within its partition, without gaps
DIVDIV 整数除法Integer division
ELT() 返回索引号处的字符串Return string at index number
EXISTS() 查询结果是否包含任何行Whether the result of a query contains any rows
EXP() 乘方Raise to the power of
EXPORT_SET() 返回一个字符串,对于值位中设置的每一位,你得到一个“开”字符串,对于未设置的每一位,你得到一个“关”字符串Return a string such that for every bit set in the value bits, you get an on string and for every unset bit, you get an off string
EXTRACT() 提取日期的一部分Extract part of a date
ExtractValue() 使用 XPath 表达式从 XML 字符串中提取值Extract a value from an XML string using XPath notation
FIELD() 第一个参数在后续参数中的索引(位置)Index (position) of first argument in subsequent arguments
FIND_IN_SET() 第一个参数在第二个参数中的索引(位置)Index (position) of first argument within second argument
FIRST_VALUE() 窗口框第一行的参数值Value of argument from first row of window frame
FLOOR() 返回不大于参数的最大整数值Return the largest integer value not greater than the argument
FORMAT() 返回格式化为指定小数位数的数字Return a number formatted to specified number of decimal places
FORMAT_BYTES() 将字节数转换为带单位的数值Convert byte count to value with units
FORMAT_PICO_TIME() 将皮秒时间转换为带单位的数值Convert time in picoseconds to value with units
FOUND_ROWS() 对于带有 LIMIT 子句的 SELECT,如果没有 LIMIT 子句将返回的行数For a SELECT with a LIMIT clause, the number of rows that would be returned were there no LIMIT clause
FROM_BASE64() 解码 base64 编码的字符串并返回结果Decode base64 encoded string and return result
FROM_DAYS() 将天数转换为日期Convert a day number to a date
FROM_UNIXTIME() 将 Unix 时间戳格式化为日期Format Unix timestamp as a date
GeomCollection() 从几何体构建几何集合Construct geometry collection from geometries
GeometryCollection() 从几何体构建几何集合Construct geometry collection from geometries
GET_DD_COLUMN_PRIVILEGES() 内部使用仅Internal use only
GET_DD_CREATE_OPTIONS() 内部使用仅Internal use only
GET_DD_INDEX_SUB_PART_LENGTH() 内部使用仅Internal use only
GET_FORMAT() 返回日期格式字符串Return a date format string
GET_LOCK() 获取一个命名锁Get a named lock
GREATEST() 返回最大的参数Return the largest argument
GROUP_CONCAT() 返回一个连接的字符串Return a concatenated string
group_replication_disable_member_action() 为指定事件禁用成员操作Disable member action for event specified
group_replication_enable_member_action() 为指定事件启用会员操作Enable member action for event specified
group_replication_get_communication_protocol() 获取当前使用的组复制通信协议版本Get version of group replication communication protocol currently in use
group_replication_get_write_concurrency() 获取当前为组设置的最大共识实例数Get maximum number of consensus instances currently set for group
group_replication_reset_member_actions() 将所有成员操作重置为默认,并将配置版本号重置为 1Reset all member actions to defaults and configuration version number to 1
group_replication_set_as_primary() 将特定群组成员设为主要成员Make a specific group member the primary
group_replication_set_communication_protocol() 设置群组复制通信协议使用的版本Set version for group replication communication protocol to use
group_replication_set_write_concurrency() 设置可以并行执行的最大共识实例数Set maximum number of consensus instances that can be executed in parallel
group_replication_switch_to_multi_primary_mode() 将以单主模式运行的组的模式更改为多主模式Changes the mode of a group running in single-primary mode to multi-primary mode
group_replication_switch_to_single_primary_mode() 将以多主模式运行的组的模式更改为单主模式Changes the mode of a group running in multi-primary mode to single-primary mode
GROUPING() 区分超级汇总 ROLLUP 行和普通行Distinguish super-aggregate ROLLUP rows from regular rows
HEX() 十六进制表示十进制或字符串值Hexadecimal representation of decimal or string value
HOUR() 提取小时Extract the hour
ICU_VERSION() ICU 库版本ICU library version
IF() 如果/否则 结构If/else construct
IFNULL() 空的 if/else 结构Null if/else construct
IN() 一个值是否在一组值中Whether a value is within a set of values
INET_ATON() 返回 IP 地址的数值Return the numeric value of an IP address
INET_NTOA() 从数值返回 IP 地址Return the IP address from a numeric value
INSERT() 在指定位置插入子字符串,最多指定字符数Insert substring at specified position up to specified number of characters
INSTR() 返回子字符串首次出现的索引Return the index of the first occurrence of substring
INTERNAL_AUTO_INCREMENT() 内部使用仅Internal use only
INTERNAL_AVG_ROW_LENGTH() 内部使用仅Internal use only
INTERNAL_CHECK_TIME() 内部使用仅Internal use only
INTERNAL_CHECKSUM() 内部使用仅Internal use only
INTERNAL_DATA_FREE() 内部使用仅Internal use only
INTERNAL_DATA_LENGTH() 内部使用仅Internal use only
INTERNAL_DD_CHAR_LENGTH() 内部使用仅Internal use only
INTERNAL_GET_COMMENT_OR_ERROR() 内部使用仅Internal use only
INTERNAL_GET_ENABLED_ROLE_JSON() 内部使用仅Internal use only
INTERNAL_GET_HOSTNAME() 内部使用仅Internal use only
INTERNAL_GET_USERNAME() 内部使用仅Internal use only
INTERNAL_GET_VIEW_WARNING_OR_ERROR() 内部使用仅Internal use only
INTERNAL_INDEX_COLUMN_CARDINALITY() 内部使用仅Internal use only
INTERNAL_INDEX_LENGTH() 内部使用仅Internal use only
INTERNAL_IS_ENABLED_ROLE() 内部使用仅Internal use only
INTERNAL_IS_MANDATORY_ROLE() 内部使用仅Internal use only
INTERNAL_KEYS_DISABLED() 内部使用仅Internal use only
INTERNAL_MAX_DATA_LENGTH() 内部使用仅Internal use only
INTERNAL_TABLE_ROWS() 内部使用仅Internal use only
INTERNAL_UPDATE_TIME() 内部使用仅Internal use only
INTERVAL() 返回小于第一个参数的参数索引Return the index of the argument that is less than the first argument
IS 将值与布尔值进行测试Test a value against a boolean
IS_FREE_LOCK() 指定的锁是否可用Whether the named lock is free
IS NOTIS NOT 将值与布尔值进行测试Test a value against a boolean
IS NOT NULLIS NOT NULL 非空值测试NOT NULL value test
IS NULLIS NULL NULL 值测试NULL value test
IS_USED_LOCK() 检查指定的锁是否被使用;如果是,则返回连接标识符Whether the named lock is in use; return connection identifier if true
IS_UUID() 参数是否是有效的 UUIDWhether argument is a valid UUID
ISNULL() 测试参数是否为 NULLTest whether the argument is NULL
JSON_ARRAY() 创建 JSON 数组Create JSON array
JSON_ARRAY_APPEND() 向 JSON 文档添加数据Append data to JSON document
JSON_ARRAY_INSERT() 插入到 JSON 数组中Insert into JSON array
JSON_ARRAYAGG() 将结果集作为单个 JSON 数组返回Return result set as a single JSON array
JSON_CONTAINS() JSON 文档是否在路径中包含特定对象Whether JSON document contains specific object at path
JSON_CONTAINS_PATH() JSON 文档的路径中是否包含任何数据Whether JSON document contains any data at path
JSON_DEPTH() JSON 文档的最大深度Maximum depth of JSON document
JSON_EXTRACT() 从 JSON 文档返回数据Return data from JSON document
JSON_INSERT() 将数据插入到 JSON 文档中Insert data into JSON document
JSON_KEYS() 来自 JSON 文档的键数组Array of keys from JSON document
JSON_LENGTH() JSON 文档中的元素数量Number of elements in JSON document
JSON_MERGE() 合并 JSON 文档,保留重复键。JSON_MERGE_PRESERVE() 的已弃用同义词Merge JSON documents, preserving duplicate keys. Deprecated synonym for JSON_MERGE_PRESERVE() 是Yes
JSON_MERGE_PATCH() 合并 JSON 文档,替换重复键的值Merge JSON documents, replacing values of duplicate keys
JSON_MERGE_PRESERVE() 合并 JSON 文档,保留重复键Merge JSON documents, preserving duplicate keys
JSON_OBJECT() 创建 JSON 对象Create JSON object
JSON_OBJECTAGG() 将结果集作为单个 JSON 对象返回Return result set as a single JSON object
JSON_OVERLAPS() 比较两个 JSON 文档,如果它们有任何键-值对或数组元素相同则返回 TRUE (1),否则返回 FALSE (0)Compares two JSON documents, returns TRUE (1) if these have any key-value pairs or array elements in common, otherwise FALSE (0)
JSON_PRETTY() 以人类可读的格式打印 JSON 文档Print a JSON document in human-readable format
JSON_QUOTE() 引用 JSON 文档Quote JSON document
JSON_REMOVE() 从 JSON 文档中删除数据Remove data from JSON document
JSON_REPLACE() 替换 JSON 文档中的值Replace values in JSON document
JSON_SCHEMA_VALID() 根据 JSON 模式验证 JSON 文档;如果文档符合模式返回 TRUE/1,否则返回 FALSE/0Validate JSON document against JSON schema; returns TRUE/1 if document validates against schema, or FALSE/0 if it does not
JSON_SCHEMA_VALIDATION_REPORT() 根据 JSON 模式验证 JSON 文档;以 JSON 格式返回验证结果报告,包括成功或失败以及失败原因Validate JSON document against JSON schema; returns report in JSON format on outcome on validation including success or failure and reasons for failure
JSON_SEARCH() JSON 文档中的值的路径Path to value within JSON document
JSON_SET() 将数据插入到 JSON 文档中Insert data into JSON document
JSON_STORAGE_FREE() 在 JSON 列值部分更新后释放的二进制表示中的空间Freed space within binary representation of JSON column value following partial update
JSON_STORAGE_SIZE() 用于存储 JSON 文档二进制表示的空间Space used for storage of binary representation of a JSON document
JSON_TABLE() 将 JSON 表达式中的数据作为关系表返回Return data from a JSON expression as a relational table
JSON_TYPE() JSON 值的类型Type of JSON value
JSON_UNQUOTE() 取消引用 JSON 值Unquote JSON value
JSON_VALID() JSON 值是否有效Whether JSON value is valid
JSON_VALUE() 从 JSON 文档中提取路径所指位置的值;将此值返回为 VARCHAR(512) 或指定类型Extract value from JSON document at location pointed to by path provided; return this value as VARCHAR(512) or specified type
LAG() 分区内滞后当前行的行的参数值Value of argument from row lagging current row within partition
LAST_DAY 返回参数月份的最后一天Return the last day of the month for the argument
LAST_INSERT_ID() 最后一次插入的 AUTOINCREMENT 列的值Value of the AUTOINCREMENT column for the last INSERT
LAST_VALUE() 窗口框最后一行的参数值Value of argument from last row of window frame
LCASE() LOWER()的同义词Synonym for LOWER()
LEAD() 分区内前一行的行值参数Value of argument from row leading current row within partition
LEAST() 返回最小的参数Return the smallest argument
LEFT() 返回指定的最左边的字符数Return the leftmost number of characters as specified
LENGTH() 返回字符串的字节长度Return the length of a string in bytes
LIKE 简单的模式匹配Simple pattern matching
LineString() 从点值构建线字符串Construct LineString from Point values
LN() 返回参数的自然对数Return the natural logarithm of the argument
LOAD_FILE() 加载指定文件Load the named file
LOCALTIME(), LOCALTIME NOW() 的同义词Synonym for NOW()
LOCALTIMESTAMP, LOCALTIMESTAMP() NOW() 的同义词Synonym for NOW()
LOCATE() 返回子字符串首次出现的位置Return the position of the first occurrence of substring
LOG() 返回第一个参数的自然对数Return the natural logarithm of the first argument
LOG10() 返回参数的以 10 为底的对数Return the base-10 logarithm of the argument
LOG2() 返回参数的以 2 为底的对数Return the base-2 logarithm of the argument
LOWER() 将参数转换为小写Return the argument in lowercase
LPAD() 返回字符串参数,并在左侧用指定的字符串填充Return the string argument, left-padded with the specified string
LTRIM() 移除前导空格Remove leading spaces
MAKE_SET() 返回一组以逗号分隔的字符串,这些字符串对应的位在 bits 中已设置Return a set of comma-separated strings that have the corresponding bit in bits set
MAKEDATE() 根据年份和一年中的天数创建日期Create a date from the year and day of year
MAKETIME() 根据小时、分钟、秒创建时间Create time from hour, minute, second
MASTER_POS_WAIT() 阻塞,直到副本已读取并应用到指定位置的所有更新Block until the replica has read and applied all updates up to the specified position 是Yes
MATCH() 执行全文搜索Perform full-text search
MAX() 返回最大值Return the maximum value
MBRContains() 一个几何体的最小外接矩形是否包含另一个几何体的最小外接矩形Whether MBR of one geometry contains MBR of another
MBRCoveredBy() 一个 MBR 是否被另一个覆盖Whether one MBR is covered by another
MBRCovers() 一个 MBR 是否覆盖另一个Whether one MBR covers another
MBRDisjoint() 两个几何体的最小边界矩形是否不相交Whether MBRs of two geometries are disjoint
MBREquals() 两个几何体的最小边界矩形是否相等Whether MBRs of two geometries are equal
MBRIntersects() 两个几何体的 MBR 是否相交Whether MBRs of two geometries intersect
MBROverlaps() 两个几何体的 MBR 是否重叠Whether MBRs of two geometries overlap
MBRTouches() 两个几何体的最小外接矩形是否接触Whether MBRs of two geometries touch
MBRWithin() 一个几何体的最小外接矩形是否位于另一个几何体的最小外接矩形内Whether MBR of one geometry is within MBR of another
MD5() 计算 MD5 校验和Calculate MD5 checksum
MEMBER OF() 如果第一个操作数与作为第二个操作数传递的 JSON 数组中的任何元素匹配,则返回 true (1),否则返回 false (0)Returns true (1) if first operand matches any element of JSON array passed as second operand, otherwise returns false (0)
MICROSECOND() 返回参数的微秒数Return the microseconds from argument
MID() 从指定位置返回子字符串Return a substring starting from the specified position
MIN() 返回最小值Return the minimum value
MINUTE() 从参数中返回分钟Return the minute from the argument
MOD() 返回余数Return the remainder
MONTH() 从传递的日期中返回月份Return the month from the date passed
MONTHNAME() 返回月份的名称Return the name of the month
MultiLineString() 从 LineString 值构建 MultiLineStringContruct MultiLineString from LineString values
MultiPoint() 从点值构建多点Construct MultiPoint from Point values
MultiPolygon() 从多边形值构建多多边形Construct MultiPolygon from Polygon values
NAME_CONST() 使该列具有给定名称Cause the column to have the given name
NOT, ! 否定值Negates value
NOT BETWEEN ... AND ...NOT BETWEEN ... AND ... 某个值是否不在某个值的范围内Whether a value is not within a range of values
NOT EXISTS() 查询结果是否不包含任何行Whether the result of a query contains no rows
NOT IN() 某个值是否不在一组值中Whether a value is not within a set of values
NOT LIKE 简单模式匹配的取反Negation of simple pattern matching
NOT REGEXPNOT REGEXP REGEXP 的否定Negation of REGEXP
NOW() 返回当前日期和时间Return the current date and time
NTH_VALUE() 来自窗口框第 N 行的参数值Value of argument from N-th row of window frame
NTILE() 当前行在其分区内的桶编号。Bucket number of current row within its partition.
NULLIF() 如果 expr1 = expr2,则返回 NULLReturn NULL if expr1 = expr2
OCT() 返回包含数字八进制表示的字符串Return a string containing octal representation of a number
OCTET_LENGTH() LENGTH() 的同义词Synonym for LENGTH()
OR, ||OR, || 逻辑或Logical OR
ORD() 返回参数最左边字符的字符编码Return character code for leftmost character of the argument
PERCENT_RANK() 百分比排名值Percentage rank value
PERIOD_ADD() 在年月后添加句号Add a period to a year-month
PERIOD_DIFF() 返回期间之间的月份数Return the number of months between periods
PI() 返回圆周率的值Return the value of pi
Point() 从坐标构建点Construct Point from coordinates
Polygon() 从 LineString 参数构建多边形Construct Polygon from LineString arguments
POSITION() LOCATE() 的同义词Synonym for LOCATE()
POW() 返回指定次方的参数Return the argument raised to the specified power
POWER() 返回指定次方的参数Return the argument raised to the specified power
PS_CURRENT_THREAD_ID() 当前线程的 Performance Schema 线程 IDPerformance Schema thread ID for current thread
PS_THREAD_ID() 给定线程的 Performance Schema 线程 IDPerformance Schema thread ID for given thread
QUARTER() 从日期参数返回季度Return the quarter from a date argument
QUOTE() 转义参数以在 SQL 语句中使用Escape the argument for use in an SQL statement
RADIANS() 返回转换为弧度的参数Return argument converted to radians
RAND() 返回一个随机浮点值Return a random floating-point value
RANDOM_BYTES() 返回一个随机字节向量Return a random byte vector
RANK() 当前行在其分区内的排名,允许有空缺Rank of current row within its partition, with gaps
REGEXPREGEXP 字符串是否匹配正则表达式Whether string matches regular expression
REGEXP_INSTR() 子字符串匹配正则表达式的起始索引Starting index of substring matching regular expression
REGEXP_LIKE() 字符串是否匹配正则表达式Whether string matches regular expression
REGEXP_REPLACE() 替换与正则表达式匹配的子字符串Replace substrings matching regular expression
REGEXP_SUBSTR() 返回匹配正则表达式的子字符串Return substring matching regular expression
RELEASE_ALL_LOCKS() 释放所有当前命名锁Release all current named locks
RELEASE_LOCK()RELEASE_LOCK() 释放命名锁Release the named lock
REPEAT() 重复指定次数的字符串Repeat a string the specified number of times
REPLACE()REPLACE() 替换指定字符串的出现Replace occurrences of a specified string
REVERSE() 反转字符串中的字符Reverse the characters in a string
RIGHT() 返回指定的最右边的字符数Return the specified rightmost number of characters
RLIKE 字符串是否匹配正则表达式Whether string matches regular expression
ROLES_GRAPHML() 返回表示内存角色子图的 GraphML 文档Return a GraphML document representing memory role subgraphs
ROUND() 围绕论点Round the argument
ROW_COUNT() 更新的行数The number of rows updated
ROW_NUMBER() 当前行在其分区内的编号Number of current row within its partition
RPAD() 将字符串附加指定次数Append string the specified number of times
RTRIM() 移除尾随空格Remove trailing spaces
SCHEMA() DATABASE() 的同义词Synonym for DATABASE()
SEC_TO_TIME() 将秒转换为“hh:mm:ss”格式Converts seconds to 'hh:mm:ss' format
SECOND() 返回第二个(0-59)Return the second (0-59)
SESSION_USER() USER() 的同义词Synonym for USER()
SHA1(), SHA() 计算 SHA-1 160 位校验和Calculate an SHA-1 160-bit checksum
SHA2() 计算 SHA-2 校验和Calculate an SHA-2 checksum
SIGN() 返回参数的符号Return the sign of the argument
SIN() 返回参数的正弦值Return the sine of the argument
SLEEP() 睡眠若干秒Sleep for a number of seconds
SOUNDEX() 返回一个 soundex 字符串Return a soundex string
SOUNDS LIKESOUNDS LIKE 比较声音Compare sounds
SOURCE_POS_WAIT() 阻塞,直到副本已读取并应用到指定位置的所有更新Block until the replica has read and applied all updates up to the specified position
SPACE() 返回指定数量空格的字符串Return a string of the specified number of spaces
SQRT() 返回参数的平方根Return the square root of the argument
ST_Area() 返回多边形或多多边形的面积Return Polygon or MultiPolygon area
ST_AsBinary(), ST_AsWKB()ST_AsBinary(), ST_AsWKB() 从内部几何格式转换为 WKBConvert from internal geometry format to WKB
ST_AsGeoJSON() 从几何生成 GeoJSON 对象Generate GeoJSON object from geometry
ST_AsText(), ST_AsWKT()ST_AsText(), ST_AsWKT() 从内部几何格式转换为 WKTConvert from internal geometry format to WKT
ST_Buffer()ST_Buffer() 返回给定距离内点的几何形状Return geometry of points within given distance from geometry
ST_Buffer_Strategy() 为 ST_Buffer() 制定策略选项Produce strategy option for ST_Buffer()
ST_Centroid() 将质心作为一个点返回Return centroid as a point
ST_Collect() 将空间值聚合到集合中Aggregate spatial values into collection
ST_Contains() 一个几何体是否包含另一个几何体Whether one geometry contains another
ST_ConvexHull()ST_ConvexHull() 返回几何体的凸包Return convex hull of geometry
ST_Crosses()ST_Crosses() 一个几何体是否与另一个几何体相交Whether one geometry crosses another
ST_Difference()ST_Difference() 返回两何体的点集差Return point set difference of two geometries
ST_Dimension()ST_Dimension() 几何的维度Dimension of geometry
ST_Disjoint() 一个几何体是否与另一个几何体不相交Whether one geometry is disjoint from another
ST_Distance() 一个几何体到另一个几何体的距离The distance of one geometry from another
ST_Distance_Sphere()ST_Distance_Sphere() 地球上两个几何体之间的最小距离Minimum distance on earth between two geometries
ST_EndPoint()ST_EndPoint() 线串的终点End Point of LineString
ST_Envelope() 返回几何的最小边界矩形Return MBR of geometry
ST_Equals() 一个几何是否等于另一个几何Whether one geometry is equal to another
ST_ExteriorRing() 返回多边形的外环Return exterior ring of Polygon
ST_FrechetDistance() 一个几何体相对于另一个几何体的离散弗雷歇距离The discrete Fréchet distance of one geometry from another
ST_GeoHash() 生成一个地理哈希值Produce a geohash value
ST_GeomCollFromText(), ST_GeometryCollectionFromText(), ST_GeomCollFromTxt() 从 WKT 返回几何集合Return geometry collection from WKT
ST_GeomCollFromWKB(), ST_GeometryCollectionFromWKB() 从 WKB 返回几何集合Return geometry collection from WKB
ST_GeometryN() 从几何集合中返回第 N 个几何体Return N-th geometry from geometry collection
ST_GeometryType() 返回几何类型的名称Return name of geometry type
ST_GeomFromGeoJSON() 从 GeoJSON 对象生成几何图形Generate geometry from GeoJSON object
ST_GeomFromText(), ST_GeometryFromText() 从 WKT 返回几何体Return geometry from WKT
ST_GeomFromWKB(), ST_GeometryFromWKB() 从 WKB 返回几何体Return geometry from WKB
ST_HausdorffDistance() 一个几何体到另一个几何体的离散豪斯多夫距离The discrete Hausdorff distance of one geometry from another
ST_InteriorRingN() 返回多边形的第 N 个内环Return N-th interior ring of Polygon
ST_Intersection() 返回两何体的点集交集Return point set intersection of two geometries
ST_Intersects() 一个几何体是否与另一个几何体相交Whether one geometry intersects another
ST_IsClosed() 几何图形是否封闭且简单Whether a geometry is closed and simple
ST_IsEmpty() 几何是否为空Whether a geometry is empty
ST_IsSimple() 几何形状是否简单Whether a geometry is simple
ST_IsValid() 几何是否有效Whether a geometry is valid
ST_LatFromGeoHash() 从地理哈希值返回纬度Return latitude from geohash value
ST_Latitude() 返回点的纬度Return latitude of Point
ST_Length() 返回 LineString 的长度Return length of LineString
ST_LineFromText(), ST_LineStringFromText() 从 WKT 构建 LineStringConstruct LineString from WKT
ST_LineFromWKB(), ST_LineStringFromWKB() 从 WKB 构建 LineStringConstruct LineString from WKB
ST_LineInterpolatePoint() 沿线串的给定百分比的点The point a given percentage along a LineString
ST_LineInterpolatePoints() 沿线串的给定百分比的点The points a given percentage along a LineString
ST_LongFromGeoHash() 从地理哈希值返回经度Return longitude from geohash value
ST_Longitude() 返回点的经度Return longitude of Point
ST_MakeEnvelope() 围绕两点的矩形Rectangle around two points
ST_MLineFromText(), ST_MultiLineStringFromText() 从 WKT 构造 MultiLineStringConstruct MultiLineString from WKT
ST_MLineFromWKB(), ST_MultiLineStringFromWKB() 从 WKB 构造 MultiLineStringConstruct MultiLineString from WKB
ST_MPointFromText(), ST_MultiPointFromText() 从 WKT 构建 MultiPointConstruct MultiPoint from WKT
ST_MPointFromWKB(), ST_MultiPointFromWKB() 从 WKB 构建 MultiPointConstruct MultiPoint from WKB
ST_MPolyFromText(), ST_MultiPolygonFromText() 从 WKT 构建多边形集合Construct MultiPolygon from WKT
ST_MPolyFromWKB(), ST_MultiPolygonFromWKB() 从 WKB 构建多边形Construct MultiPolygon from WKB
ST_NumGeometries() 返回几何集合中的几何数量Return number of geometries in geometry collection
ST_NumInteriorRing(), ST_NumInteriorRings() 返回多边形的内部环数Return number of interior rings in Polygon
ST_NumPoints() 返回 LineString 中的点数Return number of points in LineString
ST_Overlaps() 一个几何体是否与另一个几何体重叠Whether one geometry overlaps another
ST_PointAtDistance() 沿线串的给定距离的点The point a given distance along a LineString
ST_PointFromGeoHash() 将 geohash 值转换为 POINT 值Convert geohash value to POINT value
ST_PointFromText() 从 WKT 构建点Construct Point from WKT
ST_PointFromWKB() 从 WKB 构建点Construct Point from WKB
ST_PointN() 从线串中返回第 N 个点Return N-th point from LineString
ST_PolyFromText(), ST_PolygonFromText() 从 WKT 构建多边形Construct Polygon from WKT
ST_PolyFromWKB(), ST_PolygonFromWKB() 从 WKB 构建多边形Construct Polygon from WKB
ST_Simplify() 返回简化几何形状Return simplified geometry
ST_SRID() 返回几何体的空间参考系统 IDReturn spatial reference system ID for geometry
ST_StartPoint() LineString 的起点Start Point of LineString
ST_SwapXY() 返回交换了 X/Y 坐标的参数Return argument with X/Y coordinates swapped
ST_SymDifference() 返回两种几何体的点集对称差Return point set symmetric difference of two geometries
ST_Touches() 一个几何体是否接触另一个几何体Whether one geometry touches another
ST_Transform() 转换几何的坐标Transform coordinates of geometry
ST_Union() 返回两个几何体的点集并集Return point set union of two geometries
ST_Validate() 返回已验证的几何图形Return validated geometry
ST_Within() 一个几何图形是否在另一个几何图形内Whether one geometry is within another
ST_X() 返回点的 X 坐标Return X coordinate of Point
ST_Y() 返回点的 Y 坐标Return Y coordinate of Point
STATEMENT_DIGEST() 计算语句摘要哈希值Compute statement digest hash value
STATEMENT_DIGEST_TEXT() 计算归一化语句摘要Compute normalized statement digest
STD() 返回总体标准差Return the population standard deviation
STDDEV() 返回总体标准差Return the population standard deviation
STDDEV_POP() 返回总体标准差Return the population standard deviation
STDDEV_SAMP() 返回样本标准差Return the sample standard deviation
STR_TO_DATE() 将字符串转换为日期Convert a string to a date
STRCMP() 比较两个字符串Compare two strings
SUBDATE() 当使用三个参数调用时,DATE_SUB() 的同义词Synonym for DATE_SUB() when invoked with three arguments
SUBSTR() 返回指定的子字符串Return the substring as specified
SUBSTRING() 返回指定的子字符串Return the substring as specified
SUBSTRING_INDEX() 从字符串中返回指定分隔符出现次数之前的子字符串Return a substring from a string before the specified number of occurrences of the delimiter
SUBTIME() 减去次数Subtract times
SUM() 返回总和Return the sum
SYSDATE() 返回函数执行的时间Return the time at which the function executes
SYSTEM_USER() USER() 的同义词Synonym for USER()
TAN() 返回参数的正切值Return the tangent of the argument
TIME() 提取传入表达式的时间部分Extract the time portion of the expression passed
TIME_FORMAT() 格式化为时间Format as time
TIME_TO_SEC() 将参数转换为秒后返回Return the argument converted to seconds
TIMEDIFF() 减去时间Subtract time
TIMESTAMP()TIMESTAMP() 当只有一个参数时,此函数返回日期或日期时间表达式;当有两个参数时,返回参数的和With a single argument, this function returns the date or datetime expression; with two arguments, the sum of the arguments
TIMESTAMPADD() 向日期时间表达式添加一个时间间隔Add an interval to a datetime expression
TIMESTAMPDIFF() 返回两个日期时间表达式的差值,使用指定的单位Return the difference of two datetime expressions, using the units specified
TO_BASE64() 将参数转换为 base-64 字符串后返回Return the argument converted to a base-64 string
TO_DAYS() 将日期参数转换为天数Return the date argument converted to days
TO_SECONDS() 返回转换为自公元 0 年以来的秒数的日期或日期时间参数Return the date or datetime argument converted to seconds since Year 0
TRIM() 去掉首尾空格Remove leading and trailing spaces
TRUNCATE() 截断到指定的小数位数Truncate to specified number of decimal places
UCASE() UPPER() 的同义词Synonym for UPPER()
UNCOMPRESS() 解压缩已压缩的字符串Uncompress a string compressed
UNCOMPRESSED_LENGTH() 返回压缩前字符串的长度Return the length of a string before compression
UNHEX() 返回包含数字的十六进制表示的字符串Return a string containing hex representation of a number
UNIX_TIMESTAMP() 返回 Unix 时间戳Return a Unix timestamp
UpdateXML() 返回替换后的 XML 片段Return replaced XML fragment
UPPER() 转换为大写Convert to uppercase
USER() 客户端提供的用户名和主机名The user name and host name provided by the client
UTC_DATE() 返回当前的 UTC 日期Return the current UTC date
UTC_TIME() 返回当前的 UTC 时间Return the current UTC time
UTC_TIMESTAMP() 返回当前的 UTC 日期和时间Return the current UTC date and time
UUID() 返回一个通用唯一标识符 (UUID)Return a Universal Unique Identifier (UUID)
UUID_SHORT() 返回一个整数值的通用标识符Return an integer-valued universal identifier
UUID_TO_BIN() 将字符串 UUID 转换为二进制Convert string UUID to binary
VALIDATE_PASSWORD_STRENGTH() 确定密码强度Determine strength of password
VALUES() 定义在 INSERT 中使用的值Define the values to be used during an INSERT
VAR_POP() 返回总体标准方差Return the population standard variance
VAR_SAMP() 返回样本方差Return the sample variance
VARIANCE() 返回总体标准方差Return the population standard variance
VERSION() 返回一个表示 MySQL 服务器版本的字符串Return a string that indicates the MySQL server version
WAIT_FOR_EXECUTED_GTID_SET() 等待给定的 GTID 在副本上执行完毕。Wait until the given GTIDs have executed on the replica.
WEEK() 返回周数Return the week number
WEEKDAY() 返回星期索引Return the weekday index
WEEKOFYEAR() 返回日期的日历周(1-53)Return the calendar week of the date (1-53)
WEIGHT_STRING() 返回字符串的权重字符串Return the weight string for a string
XORXOR 逻辑异或Logical XOR
YEAR() 返回年份Return the year
YEARWEEK() 返回年份和周数Return the year and week
| 按位或Bitwise OR
~ 按位取反Bitwise inversion