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

相关文章
|
2月前
|
SQL 数据可视化 关系型数据库
MCP与PolarDB集成技术分析:降低SQL门槛与简化数据可视化流程的机制解析
阿里云PolarDB与MCP协议融合,打造“自然语言即分析”的新范式。通过云原生数据库与标准化AI接口协同,实现零代码、分钟级从数据到可视化洞察,打破技术壁垒,提升分析效率99%,推动企业数据能力普惠化。
238 3
|
6月前
|
SQL 存储 关系型数据库
第二篇:关系型数据库的核心概念与 SQL 基础
本篇内容深入浅出地讲解了关系型数据库的核心概念与SQL基础,适合有一定计算机基础的学习者。文章涵盖数据库的基本操作(CRUD)、数据类型、表的创建与管理等内容,并通过实例解析SELECT、INSERT、UPDATE、DELETE等语句的用法。此外,还推荐了多种学习资源与实践建议,帮助读者巩固知识。学完后,你将掌握基础数据库操作,为后续高级学习铺平道路。
379 1
|
3月前
|
边缘计算 关系型数据库 分布式数据库
PolarDB Supabase Edge Functions - 让函数,随时可用
PolarDB Supabase Edge Functions 是现代全栈开发的无服务器引擎,基于 Deno 运行时构建,支持在全球边缘节点部署自定义代码,实现低延迟、高可用的 API 与事件处理。它提供 CLI 和可视化 Studio 两种开发方式,打造高效开发闭环。相比开源版 Supabase,PolarDB Supabase 在公有云环境中实现了完整功能闭环,兼顾企业级控制力与便捷开发体验。
PolarDB Supabase Edge Functions - 让函数,随时可用
|
3月前
|
SQL 人工智能 数据挖掘
如何在`score`表中正确使用`COUNT`和`AVG`函数?SQL聚合函数COUNT与AVG使用指南
本文三桥君通过score表实例解析SQL聚合函数COUNT和AVG的常见用法。详解COUNT(studentNo)、COUNT(score)、COUNT()的区别,以及AVG函数对数值/字符型字段的不同处理,特别指出AVG()是无效语法。实战部分提供6个典型查询案例及结果,包含创建表、插入数据的完整SQL代码。产品专家三桥君强调正确理解函数特性(如空值处理、字段类型限制)对数据分析的重要性,帮助开发者避免常见误区,提升查询效率。
250 0
|
9月前
|
SQL 关系型数据库 分布式数据库
利用 PolarDB PG 版向量化引擎,加速复杂 SQL 查询!完成任务领发财新年抱枕!
利用 PolarDB PG 版向量化引擎,加速复杂 SQL 查询!完成任务领发财新年抱枕!
274 14
|
SQL Oracle 关系型数据库
SQL优化-使用联合索引和函数索引
在一次例行巡检中,发现一条使用 `to_char` 函数将日期转换为字符串的 SQL 语句 CPU 利用率很高。为了优化该语句,首先分析了 where 条件中各列的选择性,并创建了不同类型的索引,包括普通索引、函数索引和虚拟列索引。通过对比不同索引的执行计划,最终确定了使用复合索引(包含函数表达式)能够显著降低查询成本,提高执行效率。
205 3
|
SQL 数据库 数据库管理
数据库SQL函数应用技巧与方法
在数据库管理中,SQL函数是处理和分析数据的强大工具
|
SQL 数据库 索引
SQL中COUNT函数结合条件使用的技巧与方法
在SQL查询中,COUNT函数是一个非常常用的聚合函数,用于计算表中满足特定条件的记录数
2328 5
|
SQL 缓存 Cloud Native
SQL 手册-实用 SQL 语句-SQL限流
为应对突发的数据库请求流量、资源消耗过高的语句访问以及SQL访问模型的变化等问题,PolarDB-X 1.0提供了节点级别的SQL限流功能来限制造成上述问题的SQL执行,从而保证实例的持续稳定运行。本文介绍如何使用SQL限流功能。
498 0
|
关系型数据库 MySQL 网络安全
5-10Can't connect to MySQL server on 'sh-cynosl-grp-fcs50xoa.sql.tencentcdb.com' (110)")
5-10Can't connect to MySQL server on 'sh-cynosl-grp-fcs50xoa.sql.tencentcdb.com' (110)")

相关产品

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