应用管理与运维平台 ServiceStage应用管理与运维平台 ServiceStage

更新时间:2021/08/03 GMT+08:00
分享

SQL函数

DML语句对函数的支持情况请见表1,DQL语句对函数的支持情况请见表2

表1 DML语句支持函数说明

类型

MySQL

PostgreSQL

GaussDB(for MySQL)

GaussDB(openGauss)

CONCAT(string2[,…])

INSTR(string,substring)

LCASE(string2)

NA

NA

LOWER(string2)

LEFT(string2,length)

LENGTH(string)

LOAD_FILE(file_name)

LOCATE(substring,string[,start_position])

NA

NA

POSITION()

LPAD(string2,length,pad)

LTRIM(string2)

REPEAT(string2,count)

REPLACE(str,search_str,replace_str)

RPAD(string2,length,pad)

RTRIM(string2)

STRCMP(string1,string2)

SUBSTRING(str,position[,length])

TRIM([[BOTH|LEADING|TRAILING][padding]FROM]string2)

UCASE(string2)

UPPER(string2)

RIGHT(string2,length)

SPACE(count)

ABS(number2)

BIN(decimal_number)

NA

NA

CEILING(number2)

CONV(number2,from_base,to_base)

FLOOR(number2)

FORMAT(number,decimal_places)

HEX(DecimalNumber)

LEAST(number,number2[,..])

MOD(numerator,denominator)

POWER(number,power)

RAND([seed])

NA

NA

ROUND(number[,decimals])

SIGN(number2)

SQRT(number2)

ADDTIME(date2,time_interval)

NA

NA

CONVERT_TZ(datetime2,fromTZ,toTZ)

NA

NA

CURRENT_DATE()

CURRENT_TIME()

CURRENT_TIMESTAMP()

DATE(datetime)

DATE_ADD(date2,INTERVALd_valued_type)

NA

NA

DATE_FORMAT(datetime,FormatCodes)

NA

NA

DATE_SUB(date2,INTERVALd_valued_type)

NA

NA

DATEDIFF(date1,date2)

NA

NA

DAY(date)

NA

NA

DAYNAME(date)

NA

NA

DAYOFWEEK(date)

NA

NA

DAYOFYEAR(date)

NA

NA

EXTRACT(interval_nameFROMdate)

MAKEDATE(year,day)

NA

NA

MAKETIME(hour,minute,second)

NA

NA

MONTHNAME(date)

NA

NA

NOW()

SEC_TO_TIME(seconds)

NA

NA

STR_TO_DATE(string,format)

NA

NA

TIMEDIFF(datetime1,datetime2)

NA

NA

TIME_TO_SEC(time)

NA

NA

WEEK(date_time[,start_of_week])

NA

NA

YEAR(datetime)

NA

NA

DAYOFMONTH(datetime)

NA

NA

HOUR(datetime)

NA

NA

LAST_DAY(date)

NA

NA

MICROSECOND(datetime)

NA

NA

MONTH(datetime)

NA

NA

MINUTE(datetime)

NA

NA

FIRST()

LAST()

MIN()

MAX()

AVG()

SUM()

COUNT()

UPDATE JOIN

表2 DQL语句支持函数说明

类型

MySQL

PostgreSQL

GaussDB(for MySQL)

GaussDB(openGauss)

CONCAT(string2[,…])

INSTR(string,substring)

LCASE(string2)

NA

NA

LOWER(string2)

LEFT(string2,length)

LENGTH(string)

LOAD_FILE(file_name)

LOCATE(substring,string[,start_position])

NA

NA

POSITION()

LPAD(string2,length,pad)

LTRIM(string2)

REPEAT(string2,count)

REPLACE(str,search_str,replace_str)

RPAD(string2,length,pad)

RTRIM(string2)

STRCMP(string1,string2)

SUBSTRING(str,position[,length])

TRIM([[BOTH|LEADING|TRAILING][padding]FROM]string2)

UCASE(string2)

UPPER(string2)

RIGHT(string2,length)

SPACE(count)

ABS(number2)

BIN(decimal_number)

NA

NA

CEILING(number2)

CONV(number2,from_base,to_base)

FLOOR(number2)

FORMAT(number,decimal_places)

HEX(DecimalNumber)

LEAST(number,number2[,..])

MOD(numerator,denominator)

POWER(number,power)

RAND([seed])

NA

NA

ROUND(number[,decimals])

SIGN(number2)

SQRT(number2)

ADDTIME(date2,time_interval)

NA

NA

CONVERT_TZ(datetime2,fromTZ,toTZ)

NA

NA

CURRENT_DATE()

CURRENT_TIME()

CURRENT_TIMESTAMP()

DATE(datetime)

DATE_ADD(date2,INTERVALd_valued_type)

NA

NA

DATE_FORMAT(datetime,FormatCodes)

NA

NA

DATE_SUB(date2,INTERVALd_valued_type)

NA

NA

DATEDIFF(date1,date2)

NA

NA

DAY(date)

NA

NA

DAYNAME(date)

NA

NA

DAYOFWEEK(date)

NA

NA

DAYOFYEAR(date)

NA

NA

EXTRACT(interval_nameFROMdate)

MAKEDATE(year,day)

NA

NA

MAKETIME(hour,minute,second)

NA

NA

MONTHNAME(date)

NA

NA

NOW()

SEC_TO_TIME(seconds)

NA

NA

STR_TO_DATE(string,format)

NA

NA

TIMEDIFF(datetime1,datetime2)

NA

NA

TIME_TO_SEC(time)

NA

NA

WEEK(date_time[,start_of_week])

NA

NA

YEAR(datetime)

NA

NA

DAYOFMONTH(datetime)

NA

NA

HOUR(datetime)

NA

NA

LAST_DAY(date)

NA

NA

MICROSECOND(datetime)

NA

NA

MONTH(datetime)

NA

NA

MINUTE(datetime)

NA

NA

FIRST()

LAST()

MIN()

MAX()

AVG()

SUM()

COUNT()

FROM_UNIXTIME

NA

NA

UNIX_TIMESTAMP

NA

NA

CASE-WHEN-THEN

COALESCE

IF/IFNULL

NA

NA

CAST

CONVERT

NA

NA

GROUP_CONCAT

NA

NA

分享:

    相关文档

    相关产品