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分布式版,支持一键拉起使用,方便各位开发者学习使用。
相关文章
|
11天前
|
SQL 数据处理 数据库
SQL中的函数有哪些类型
【8月更文挑战第20天】SQL中的函数有哪些类型
12 1
|
6天前
|
SQL JavaScript 前端开发
【Azure 应用服务】Azure JS Function 异步方法中执行SQL查询后,Callback函数中日志无法输出问题
【Azure 应用服务】Azure JS Function 异步方法中执行SQL查询后,Callback函数中日志无法输出问题
|
8天前
|
SQL
6、SQL函数
6、SQL函数
|
11天前
|
SQL 数据采集 存储
"揭秘SQL Server中REPLACE函数的神奇力量!一键替换字符串,解锁数据处理的无限可能,你还在等什么?"
【8月更文挑战第20天】SQL Server 的 REPLACE 函数是处理字符串的强大工具,用于在查询中替换字符串的部分内容。基本语法为 `REPLACE(string_expression, string_pattern, string_replacement)`。例如,可将员工邮箱从 `@example.com` 替换为 `@newdomain.com`。支持多级嵌套替换与变量结合使用,适用于动态生成查询。注意大小写敏感性及全局替换特性。掌握 REPLACE 函数能有效提升数据处理能力。
33 0
|
SQL 存储 关系型数据库
PolarDB-X 1.0-用户指南—SQL调优指南—SQL调优基础概念
在使用PolarDB-X的过程中,可能出现性能不符合预期的慢SQL。SQL调优的过程,就是通过分析SQL的执行计划、各阶段运行时长等信息,找出导致SQL执行慢的原因,继而解决问题。
158 0
PolarDB-X 1.0-用户指南—SQL调优指南—SQL调优基础概念
|
2月前
|
SQL 存储 监控
SQL Server的并行实施如何优化?
【7月更文挑战第23天】SQL Server的并行实施如何优化?
49 13
|
2月前
|
SQL
解锁 SQL Server 2022的时间序列数据功能
【7月更文挑战第14天】要解锁SQL Server 2022的时间序列数据功能,可使用`generate_series`函数生成整数序列,例如:`SELECT value FROM generate_series(1, 10)。此外,`date_bucket`函数能按指定间隔(如周)对日期时间值分组,这些工具结合窗口函数和其他时间日期函数,能高效处理和分析时间序列数据。更多信息请参考官方文档和技术资料。
|
2月前
|
SQL 存储 网络安全
关系数据库SQLserver 安装 SQL Server
【7月更文挑战第26天】
40 6
|
18天前
|
SQL 安全 Java
驱动程序无法通过使用安全套接字层(SSL)加密与 SQL Server 建立安全连接。错误:“The server selected protocol version TLS10 is not accepted by client
驱动程序无法通过使用安全套接字层(SSL)加密与 SQL Server 建立安全连接。错误:“The server selected protocol version TLS10 is not accepted by client
80 0
|
2月前
|
存储 SQL C++
对比 SQL Server中的VARCHAR(max) 与VARCHAR(n) 数据类型
【7月更文挑战7天】SQL Server 中的 VARCHAR(max) vs VARCHAR(n): - VARCHAR(n) 存储最多 n 个字符(1-8000),适合短文本。 - VARCHAR(max) 可存储约 21 亿个字符,适合大量文本。 - VARCHAR(n) 在处理小数据时性能更好,空间固定。 - VARCHAR(max) 对于大文本更合适,但可能影响性能。 - 选择取决于数据长度预期和业务需求。

相关产品

  • 云原生分布式数据库 PolarDB-X
  • 下一篇
    云函数