หน้านี้ยังไม่พร้อมใช้งานในภาษาท้องถิ่นของคุณ เรากำลังพยายามอย่างหนักเพื่อเพิ่มเวอร์ชันภาษาอื่น ๆ เพิ่มเติม ขอบคุณสำหรับการสนับสนุนเสมอมา

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Functions

Updated on 2024-12-30 GMT+08:00

Mathematics Functions

Table 1 Mathematics Functions

Function

Purpose

Description

Example Value

abs

Absolute value

abs(number T) -> T

SELECT abs(0.5) LIMIT 1

add

Addition

add(number T, number) -> T

SELECT add(1, 5) LIMIT 1

cbrt

Cubic root

cbrt(number T) -> T

SELECT cbrt(0.5) LIMIT 1

ceil

Rounded up

ceil(number T) -> T

SELECT ceil(0.5) LIMIT 1

divide

Division

divide(number T, number) -> T

SELECT divide(1, 0.5) LIMIT 1

e

Natural base number e

e() -> double

SELECT e() LIMIT 1

exp

Power of the natural base number e

exp(number T) -> T

SELECT exp(0.5) LIMIT 1

expm1

Subtract one from the power of the natural base number e.

expm1(number T) -> T

SELECT expm1(0.5) LIMIT 1

floor

Rounded down

floor(number T) -> T

SELECT floor(0.5) AS Rounded_Down LIMIT 1

ln

Returns the natural logarithm.

ln(number T) -> double

SELECT ln(10) LIMIT 1

log

Logarithm with T as the base

log(number T, number) -> double

SELECT log(10) LIMIT 1

log2

Logarithm with 2 as the base

log2(number T) -> double

SELECT log2(10) LIMIT 1

log10

Logarithm to base 10

log10(number T) -> double

SELECT log10(10) LIMIT 1

mod

Remainder

mod(number T, number) -> T

SELECT modulus(2, 3) LIMIT 1

multiply

Multiplication

multiply(number T, number) -> number

SELECT multiply(2, 3) LIMIT 1

pi

π

pi() -> double

SELECT pi() LIMIT 1

pow

T power of

pow(number T, number) -> T

SELECT pow(2, 3) LIMIT 1

power

T power of

power(number T) -> T, power(number T, number) -> T

SELECT power(2, 3) LIMIT 1

rand

Random number.

rand() -> number, rand(number T) -> T

SELECT rand(5) LIMIT 1

rint

Discard decimals.

rint(number T) -> T

SELECT rint(1.5) LIMIT 1

round

Round off

round(number T) -> T

SELECT round(1.5) LIMIT 1

sign

Symbol

sign(number T) -> T

SELECT sign(1.5) LIMIT 1

signum

Symbol

signum(number T) -> T

SELECT signum(0.5) LIMIT 1

sqrt

Square root

sqrt(number T) -> T

SELECT sqrt(0.5) LIMIT 1

subtract

Subtraction

subtract(number T, number) -> T

SELECT subtract(3, 2) LIMIT 1

/

Division

number / number -> number

SELECT 1 / 100 LIMIT 1

%

Remainder

number % number -> number

SELECT 1 % 100 LIMIT 1

Trigonometric Functions

Table 2 Trigonometric functions

Functions

Purpose

Description

Example Value

acos

Arc cosine

acos(number T) -> double

SELECT acos(0.5) LIMIT 1

asin

Arc sine

asin(number T) -> double

SELECT asin(0.5) LIMIT 1

atan

Inverse tangent

atan(number T) -> double

SELECT atan(0.5) LIMIT 1

atan2

T Arc tangent of the result of dividing U

atan2(number T, number U) -> double

SELECT atan2(1, 0.5) LIMIT 1

cos

Cosine

cos(number T) -> double

SELECT cos(0.5) LIMIT 1

cosh

hyperbolic cosine

cosh(number T) -> double

SELECT cosh(0.5) LIMIT 1

cot

Cotangent

cot(number T) -> double

SELECT cot(0.5) LIMIT 1

degrees

Converting radians into degrees

degrees(number T) -> double

SELECT degrees(0.5) LIMIT 1

radians

Converting degrees into radians

radians(number T) -> double

SELECT radians(0.5) LIMIT 1

sin

Sine

sin(number T) -> double

SELECT sin(0.5) LIMIT 1

sinh

hyperbolic sine

sinh(number T) -> double

SELECT sinh(0.5) LIMIT 1

tan

Tangent

tan(number T) -> double

SELECT tan(0.5) LIMIT 1

Temporal Functions

Table 3 Temporal functions

Function

Purpose

Description

Example Value

curdate

Specifies the current date.

curdate() -> date

SELECT curdate() LIMIT 1

date

Date

date(date) -> date

SELECT date() LIMIT 1

date_format

Obtains the date value based on the format.

date_format(date, string) -> string

SELECT date_format(date, 'Y') LIMIT 1

day_of_month

Month

day_of_month(date) -> integer

SELECT day_of_month(date) LIMIT 1

day_of_week

Day of a week

day_of_week(date) -> integer

SELECT day_of_week(date) LIMIT 1

day_of_year

Number of days in the current year

day_of_year(date) -> integer

SELECT day_of_year(date) LIMIT 1

hour_of_day

Number of hours on the current day

hour_of_day(date) -> integer

SELECT hour_of_day(date) LIMIT 1

maketime

Date of Generation

maketime(integer, integer, integer) -> time

SELECT maketime(11, 30, 00) LIMIT 1

minute_of_hour

Number of minutes in the current hour

minute_of_hour(date) -> integer

SELECT minute_of_hour(date) LIMIT 1

minute_of_day

Number of minutes on the current day

minute_of_day(date) -> integer

SELECT minute_of_day(date) LIMIT 1

monthname

Month Name

monthname(date) -> string

SELECT monthname(date) LIMIT 1

now

Current time.

now() -> time

SELECT now() LIMIT 1

second_of_minute

Number of seconds

minute_of_day(date) -> integer

SELECT minute_of_day(date) LIMIT 1

timestamp

Date

timestamp(date) -> date

SELECT timestamp(date) LIMIT 1

year

Year

year(date) -> integer

SELECT year(date) LIMIT 1

Text Functions

Table 4 Text functions

Function

Purpose

Description

Example Value

ascii

ASCII value of the first character

ascii(string T) -> integer

SELECT ascii('t') LIMIT 1

concat_ws

Connection String

concat_ws(separator, string, string) -> string

SELECT concat_ws('-', 'Tutorial', 'is', 'fun!') LIMIT 1

left

Obtain a character string from left to right.

left(string T, integer) -> T

SELECT left('hello', 2) LIMIT 1

length

length

length(string) -> integer

SELECT length('hello') LIMIT 1

locate

Search for a string

locate(string, string) -> integer

SELECT locate('o', 'hello') LIMIT 1

replace

Replace strings

replace(string T, string, string) -> T

SELECT replace('hello', 'l', 'x') LIMIT 1

right

Obtain a character string from right to left.

right(string T, integer) -> T

SELECT right('hello', 1) LIMIT 1

rtrim

Remove the empty character string on the right.

rtrim(string T) -> T

SELECT rtrim('hello ') LIMIT 1

substring

Obtaining a Substring

substring(string T, integer, integer) -> T

SELECT substring('hello', 2,5) LIMIT 1

trim

Remove empty character strings on both sides.

trim(string T) -> T

SELECT trim(' hello ') LIMIT 1

upper

Convert all letters into uppercase letters.

upper(string T) -> T

SELECT upper('helloworld') LIMIT 1

Other

Table 5 Other

Function

Purpose

Description

Example Value

if

if condition

if(boolean, object, object) -> object

SELECT if(false, 0, 1) LIMIT 1 ,

SELECT if(true, 0, 1) LIMIT 1

ifnull

If the field is null, the default value is used.

ifnull(object, object) -> object

SELECT ifnull('hello', 1) LIMIT 1 ,

SELECT ifnull(null, 1) LIMIT 1

isnull

Indicates whether a field is null. If yes, 1 is returned. If no, 0 is returned.

isnull(object) -> integer

SELECT isnull(null) LIMIT 1 ,

SELECT isnull(1) LIMIT 1

เราใช้คุกกี้เพื่อปรับปรุงไซต์และประสบการณ์การใช้ของคุณ การเรียกดูเว็บไซต์ของเราต่อแสดงว่าคุณยอมรับนโยบายคุกกี้ของเรา เรียนรู้เพิ่มเติม

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback