PolarDB-X 1.0-SQL 手册-函数-函数

本文涉及的产品
云原生数据库 PolarDB 分布式版,标准版 2核8GB
简介: DRDS 支持的函数分为日期时间函数、字符串函数、转换函数、聚合函数、数学函数、比较函数、位函数、控制流程函数、信息函数、加密和压缩函数以及其他函数;JSON 函数和地理信息函数的下推执行。

DRDS 支持的函数分为日期时间函数、字符串函数、转换函数、聚合函数、数学函数、比较函数、位函数、控制流程函数、信息函数、加密和压缩函数以及其他函数;JSON 函数和地理信息函数的下推执行。

以下函数出现在WHERE条件、UPDATE语句中,DRDS不支持:LAST_INSERT_ID()CONNECTION_ID()CURRENT_USER(), CURRENT_USERDATABASE()SCHEMA()USER()VERSION()

与 MySQL5.7 相比,DRDS 不支持以下几类函数:

已经支持的几类函数中,有如下函数不支持:

类别

函数名

描述

日期时间函数

CONVERT_TZ()

Convert from one time zone to another

GET_FORMAT()

Return a date format string

LOCALTIME(), LOCALTIME

Synonym for NOW()

LOCALTIMESTAMP, LOCALTIMESTAMP()

Synonym for NOW()

字符串函数

FIND_IN_SET()

Return the index position of the first argument within the second argument

LOAD_FILE()

Load the named file

MATCH

Perform full-text search

SOUNDS LIKE

Compare sounds

聚合函数

BIT_AND(

Return bitwise AND

BIT_OR()

Return bitwise OR

BIT_XOR()

Return bitwise XOR

GROUP_CONCAT()

Return a concatenated string

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

VAR_POP()

Return the population standard variance

VAR_SAMP()

Return the sample variance

VARIANCE()

Return the population standard variance

数学函数

RADIANS()

Return argument converted to radians

信息函数

BENCHMARK()

Repeatedly execute an expression

CHARSET()

Return the character set of the argument

COERCIBILITY()

Return the collation coercibility value of the string argument

COLLATION()

Return the collation of the string argument

FOUND_ROWS()

For a SELECT with a LIMIT clause, the number of rows that would be returned were there no LIMIT clause

ROW_COUNT()

The number of rows updated

加密和压缩函数


ASYMMETRIC_DECRYPT()

Decrypt ciphertext using private or public key

ASYMMETRIC_DERIVE()

Derive symmetric key from asymmetric keys

ASYMMETRIC_ENCRYPT()

Encrypt cleartext using private or public key

ASYMMETRIC_SIGN()

Generate signature from digest

ASYMMETRIC_VERIFY()

Verify that signature matches digest

CREATE_ASYMMETRIC_PRIV_KEY()

Create private key

CREATE_ASYMMETRIC_PUB_KEY()

Create public key

CREATE_DH_PARAMETERS()

Generate shared DH secret

CREATE_DIGEST()

Generate digest from string

DECODE() (deprecated 5.7.2)

Decodes a string encrypted using ENCODE()

DES_DECRYPT() (deprecated 5.7.6)

Decrypt a string

DES_ENCRYPT() (deprecated 5.7.6)

Encrypt a string

ENCODE() (deprecated 5.7.2)

Encode a string

ENCRYPT() (deprecated 5.7.6)

Encrypt a string

OLD_PASSWORD()

Return the value of the pre-4.1 implementation of PASSWORD

PASSWORD() (deprecated 5.7.6)

Calculate and return a password string

RANDOM_BYTES()

Return a random byte vector

SHA1(), SHA()

Calculate an SHA-1 160-bit checksum

SHA2()

Calculate an SHA-2 checksum

VALIDATE_PASSWORD_STRENGTH()

Determine strength of password

其他函数

ANY_VALUE()

Suppress ONLY_FULL_GROUP_BY value rejection

DEFAULT()

Return the default value for a table column

GET_LOCK()

Get a named lock

INET_ATON()

Return the numeric value of an IP address

INET_NTOA()

Return the IP address from a numeric value

INET6_ATON()

Return the numeric value of an IPv6 address

INET6_NTOA()

Return the IPv6 address from a numeric value

IS_FREE_LOCK()

Whether the named lock is free

IS_IPV4()

Whether argument is an IPv4 address

IS_IPV4_COMPAT()

Whether argument is an IPv4-compatible address

IS_IPV4_MAPPED()

Whether argument is an IPv4-mapped address

IS_IPV6()

Whether argument is an IPv6 address

IS_USED_LOCK()

Whether the named lock is in use; return connection identifier if true

MASTER_POS_WAIT()

Block until the slave has read and applied all updates up to the specified position

NAME_CONST()

Causes the column to have the given name

相关实践学习
快速体验PolarDB开源数据库
本实验环境已内置PostgreSQL数据库以及PolarDB开源数据库:PolarDB PostgreSQL版和PolarDB分布式版,支持一键拉起使用,方便各位开发者学习使用。
相关文章
|
SQL 监控 数据库
PolarDB-X 2.0,同一条sql,有时执行200ms,有时8000毫秒,是什么原因,频率很高.?
PolarDB-X 2.0,同一条sql,有时执行200ms,有时8000毫秒,是什么原因,频率很高.?
136 1
|
10月前
|
关系型数据库 分布式数据库 数据库
PolarDB产品使用问题之将RDS切换到PolarDB-X 2.0时,代码层的SQL该如何改动
PolarDB产品使用合集涵盖了从创建与管理、数据管理、性能优化与诊断、安全与合规到生态与集成、运维与支持等全方位的功能和服务,旨在帮助企业轻松构建高可用、高性能且易于管理的数据库环境,满足不同业务场景的需求。用户可以通过阿里云控制台、API、SDK等方式便捷地使用这些功能,实现数据库的高效运维与持续优化。
|
SQL 关系型数据库 分布式数据库
drds和polardb的sql语句分别有哪些
drds和polardb的sql语句分别有哪些
193 1
|
11月前
|
SQL 存储 关系型数据库
PolarDB产品使用合集之有的sql里面有自定义存储函数 如果想走列存有什么优化建议吗
PolarDB是阿里云推出的一种云原生数据库服务,专为云设计,提供兼容MySQL、PostgreSQL的高性能、低成本、弹性可扩展的数据库解决方案,可以有效地管理和优化PolarDB实例,确保数据库服务的稳定、高效运行。以下是使用PolarDB产品的一些建议和最佳实践合集。
373 0
|
12月前
|
SQL 关系型数据库 分布式数据库
在PolarDB for PostgreSQL中,你可以使用LIKE运算符来实现类似的查询功能,而不是使用IF函数
在PolarDB for PostgreSQL中,你可以使用LIKE运算符来实现类似的查询功能,而不是使用IF函数
132 7
|
关系型数据库 MySQL 数据库
史上最全的MySQL性能手册(优化+SQL+并发+数据库)
史上最全的MySQL性能手册(优化+SQL+并发+数据库)
|
12月前
|
SQL 存储 缓存
PolarDB-X SQL限流
本文首先介绍了SQL限流的使用场景,它可通过限制边缘业务查询,留出资源来为核心业务保驾护航。接着是功能简介,PolarDB-X结合自身云原生分布式的特点,提供了具有简洁易用的交互接口、多样的限流策略、平均复杂度O(1)、节点级限流实例级监控的SQL限流能力。
220 1
PolarDB-X SQL限流
|
SQL 弹性计算 测试技术
如何在PolarDB-X中优化慢SQL
《PolarDB-X动手实践》系列第六期,本场景带您体验如何使用PolarDB-X提供的解决慢SQL的相关工具。
|
12月前
|
SQL Java 调度
PolarDB-X SQL限流 (二)
当前PolarDB-X正在全面对接阿里云 ''数据库自治服务 DAS",PolarDB-X限流能力将会以白屏化的方式提供给用户,经一步提升用户体验,降低使用门槛。
222 0
PolarDB-X SQL限流 (二)
|
12月前
|
SQL 弹性计算 测试技术
实践教程之如何在PolarDB-X中优化慢SQL
PolarDB-X 为了方便用户体验,提供了免费的实验环境,您可以在实验环境里体验 PolarDB-X 的安装部署和各种内核特性。除了免费的实验,PolarDB-X 也提供免费的视频课程,手把手教你玩转 PolarDB-X 分布式数据库。本期实验将指导您使用对 PolarDB-X 进行慢SQL优化。...
实践教程之如何在PolarDB-X中优化慢SQL

相关产品

  • 云原生分布式数据库 PolarDB-X