未验证 提交 a1793090 编写于 作者: S shenglian-zhou 提交者: GitHub

Merge pull request #10797 from taosdata/docs/TD-13973

TD-13973: document for 2.6.0.x
......@@ -1628,9 +1628,9 @@ TDengine支持针对数据的聚合查询。提供支持的聚合和选择函数
- **DIFF**
```mysql
SELECT DIFF(field_name) FROM tb_name [WHERE clause];
SELECT {DIFF(field_name, ignore_negative) | DIFF(field_name)} FROM tb_name [WHERE clause];
```
功能说明:统计表中某列的值与前一行对应值的差。
功能说明:统计表中某列的值与前一行对应值的差。 ignore_negative 取值为 0|1 , 可以不填,默认值为 0. 不忽略负值。ignore_negative为1时表示忽略负数。
返回结果数据类型:同应用字段。
......@@ -1638,7 +1638,7 @@ TDengine支持针对数据的聚合查询。提供支持的聚合和选择函数
适用于:**表、(超级表)**。
说明:输出结果行数是范围内总行数减一,第一行没有结果输出。从 2.1.3.0 版本开始,DIFF 函数可以在由 GROUP BY 划分出单独时间线的情况下用于超级表(也即 GROUP BY tbname)。
说明:输出结果行数是范围内总行数减一,第一行没有结果输出。从 2.1.3.0 版本开始,DIFF 函数可以在由 GROUP BY 划分出单独时间线的情况下用于超级表(也即 GROUP BY tbname)。从2.6.0开始,DIFF函数支持ignore_negative参数
示例:
```mysql
......@@ -1722,7 +1722,7 @@ TDengine支持针对数据的聚合查询。提供支持的聚合和选择函数
支持 +、-、*、/ 运算,如 ceil(col1) + ceil(col2)。
只能与普通列,选择(Selection)、投影(Projection)函数一起使用,不能与聚合(Aggregation)函数一起使用。
该函数可以应用在普通表和超级表上。
- **FLOOR**
```mysql
SELECT FLOOR(field_name) FROM { tb_name | stb_name } [WHERE clause];
......@@ -1737,6 +1737,381 @@ TDengine支持针对数据的聚合查询。提供支持的聚合和选择函数
功能说明:获得指定列的四舍五入的结果。
其他使用说明参见CEIL函数描述。
- **ASIN**
```mysql
SELECT ASIN(field_name) FROM { tb_name | stb_name } [WHERE clause]
```
功能说明:获得指定列的反正弦结果
返回结果类型:DOUBLE。如果输入值为NULL,输出值也为NULL
适用数据类型:不能应用在 timestamp、binary、nchar、bool 类型字段上;在超级表查询中使用时,不能应用在 tag 列
嵌套子查询支持:适用于内层查询和外层查询。
使用说明:
只能与普通列,选择(Selection)、投影(Projection)函数一起使用,不能与聚合(Aggregation)函数一起使用。
该函数可以应用在普通表和超级表上。
- **ACOS**
```mysql
SELECT ACOS(field_name) FROM { tb_name | stb_name } [WHERE clause]
```
功能说明:获得指定列的反余弦结果
返回结果类型:DOUBLE。如果输入值为NULL,输出值也为NULL
适用数据类型:不能应用在 timestamp、binary、nchar、bool 类型字段上;在超级表查询中使用时,不能应用在 tag 列
嵌套子查询支持:适用于内层查询和外层查询。
使用说明:
只能与普通列,选择(Selection)、投影(Projection)函数一起使用,不能与聚合(Aggregation)函数一起使用。
该函数可以应用在普通表和超级表上。
- **ATAN**
```mysql
SELECT ATAN(field_name) FROM { tb_name | stb_name } [WHERE clause]
```
功能说明:获得指定列的反正切结果
返回结果类型:DOUBLE。如果输入值为NULL,输出值也为NULL
适用数据类型:不能应用在 timestamp、binary、nchar、bool 类型字段上;在超级表查询中使用时,不能应用在 tag 列
嵌套子查询支持:适用于内层查询和外层查询。
使用说明:
只能与普通列,选择(Selection)、投影(Projection)函数一起使用,不能与聚合(Aggregation)函数一起使用。
该函数可以应用在普通表和超级表上。
版本2.6.0.x后支持
- **SIN**
```mysql
SELECT SIN(field_name) FROM { tb_name | stb_name } [WHERE clause]
```
功能说明:获得指定列的正弦结果
返回结果类型:DOUBLE。如果输入值为NULL,输出值也为NULL
适用数据类型:不能应用在 timestamp、binary、nchar、bool 类型字段上;在超级表查询中使用时,不能应用在 tag 列
嵌套子查询支持:适用于内层查询和外层查询。
使用说明:
只能与普通列,选择(Selection)、投影(Projection)函数一起使用,不能与聚合(Aggregation)函数一起使用。
该函数可以应用在普通表和超级表上。
版本2.6.0.x后支持
- **COS**
```mysql
SELECT COS(field_name) FROM { tb_name | stb_name } [WHERE clause]
```
功能说明:获得指定列的余弦结果
返回结果类型:DOUBLE。如果输入值为NULL,输出值也为NULL
适用数据类型:不能应用在 timestamp、binary、nchar、bool 类型字段上;在超级表查询中使用时,不能应用在 tag 列
嵌套子查询支持:适用于内层查询和外层查询。
使用说明:
只能与普通列,选择(Selection)、投影(Projection)函数一起使用,不能与聚合(Aggregation)函数一起使用。
该函数可以应用在普通表和超级表上。
版本2.6.0.x后支持
- **TAN**
```mysql
SELECT TAN(field_name) FROM { tb_name | stb_name } [WHERE clause]
```
功能说明:获得指定列的正切结果
返回结果类型:DOUBLE。如果输入值为NULL,输出值也为NULL
适用数据类型:不能应用在 timestamp、binary、nchar、bool 类型字段上;在超级表查询中使用时,不能应用在 tag 列
嵌套子查询支持:适用于内层查询和外层查询。
使用说明:
只能与普通列,选择(Selection)、投影(Projection)函数一起使用,不能与聚合(Aggregation)函数一起使用。
该函数可以应用在普通表和超级表上。
版本2.6.0.x后支持
- **POW**
```mysql
SELECT POW(field_name, power) FROM { tb_name | stb_name } [WHERE clause]
```
功能说明:获得指定列的指数为power的幂
返回结果类型:DOUBLE。如果输入值为NULL,输出值也为NULL
适用数据类型:不能应用在 timestamp、binary、nchar、bool 类型字段上;在超级表查询中使用时,不能应用在 tag 列
嵌套子查询支持:适用于内层查询和外层查询。
使用说明:
只能与普通列,选择(Selection)、投影(Projection)函数一起使用,不能与聚合(Aggregation)函数一起使用。
该函数可以应用在普通表和超级表上。
版本2.6.0.x后支持
- **LOG**
```mysql
SELECT LOG(field_name, base) FROM { tb_name | stb_name } [WHERE clause]
```
功能说明:获得指定列对于底数base的对数
返回结果类型:DOUBLE。如果输入值为NULL,输出值也为NULL
适用数据类型:不能应用在 timestamp、binary、nchar、bool 类型字段上;在超级表查询中使用时,不能应用在 tag 列
嵌套子查询支持:适用于内层查询和外层查询。
使用说明:
只能与普通列,选择(Selection)、投影(Projection)函数一起使用,不能与聚合(Aggregation)函数一起使用。
该函数可以应用在普通表和超级表上。
版本2.6.0.x后支持
- **ABS**
```mysql
SELECT ABS(field_name) FROM { tb_name | stb_name } [WHERE clause]
```
功能说明:获得指定列的绝对值
返回结果类型:如果输入值为整数,输出值是UBIGINT类型。如果输入值是FLOAT/DOUBLE数据类型,输出值是DOUBLE数据类型。
适用数据类型:不能应用在 timestamp、binary、nchar、bool 类型字段上;在超级表查询中使用时,不能应用在 tag 列
嵌套子查询支持:适用于内层查询和外层查询。
使用说明:
只能与普通列,选择(Selection)、投影(Projection)函数一起使用,不能与聚合(Aggregation)函数一起使用。
该函数可以应用在普通表和超级表上。
版本2.6.0.x后支持
- **SQRT**
```mysql
SELECT SQRT(field_name) FROM { tb_name | stb_name } [WHERE clause]
```
功能说明:获得指定列的平方根
返回结果类型:DOUBLE。如果输入值为NULL,输出值也为NULL
适用数据类型:不能应用在 timestamp、binary、nchar、bool 类型字段上;在超级表查询中使用时,不能应用在 tag 列
嵌套子查询支持:适用于内层查询和外层查询。
使用说明:
只能与普通列,选择(Selection)、投影(Projection)函数一起使用,不能与聚合(Aggregation)函数一起使用。
该函数可以应用在普通表和超级表上。
版本2.6.0.x后支持
- **CAST**
```mysql
SELECT CAST(expression AS type_name) FROM { tb_name | stb_name } [WHERE clause]
```
功能说明:数据类型转换函数,输入参数expression支持普通列、常量、标量函数及它们之间的四则运算,不支持tag列,只适用于select子句中。
返回结果类型:CAST中指定的类型(type_name)。
适用数据类型:输入参数expression的类型可以是除JSON外目前所有类型字段(BOOL/TINYINT/SMALLINT/INT/BIGINT/FLOAT/DOUBLE/BINARY(M)/TIMESTAMP/NCHAR(M)/TINYINT UNSIGNED/SMALLINT UNSIGNED/INT UNSIGNED/BIGINT UNSIGNED); 输出目标类型只支持BIGINT/BINARY(N)/TIMESTAMP/NCHAR(N)/BIGINT UNSIGNED。
说明:
对于不能支持的类型转换会直接报错。
如果输入值为NULL则输出值也为NULL。
对于类型支持但某些值无法正确转换的情况对应的转换后的值以转换函数输出为准。目前可能遇到的几种情况:
1)BINARY/NCHAR转BIGINT/BIGINT UNSIGNED时可能出现的无效字符情况,例如"a"可能转为0。
2)有符号数或TIMESTAMP转BIGINT UNSIGNED可能遇到的溢出问题。
3)BIGINT UNSIGNED转BIGINT可能遇到的溢出问题。
4)FLOAT/DOUBLE转BIGINT/BIGINT UNSIGNED可能遇到的溢出问题。
版本2.6.0.x后支持
- **CONCAT**
```mysql
SELECT CONCAT(str1|column1, str2|column2, ...) FROM { tb_name | stb_name } [WHERE clause]
```
功能说明:字符串连接函数。
返回结果类型:同输入参数类型,BINARY或者NCHAR。
适用数据类型:输入参数或者全部是BINARY格式的字符串或者列,或者全部是NCHAR格式的字符串或者列。不能应用在TAG列。
说明:
如果输入值为NULL,输出值为NULL。
该函数最小参数个数为2个,最大参数个数为8个。
该函数可以应用在普通表和超级表上。
该函数适用于内层查询和外层查询。
版本2.6.0.x后支持
- **CONCAT_WS**
```
SELECT CONCAT_WS(separator, str1|column1, str2|column2, ...) FROM { tb_name | stb_name } [WHERE clause]
```
功能说明:带分隔符的字符串连接函数。
返回结果类型:同输入参数类型,BINARY或者NCHAR。
适用数据类型:输入参数或者全部是BINARY格式的字符串或者列,或者全部是NCHAR格式的字符串或者列。不能应用在TAG列。
说明:
如果separator值为NULL,输出值为NULL。如果separator值不为NULL,其他输入为NULL,输出为空串
该函数最小参数个数为3个,最大参数个数为9个。
该函数可以应用在普通表和超级表上。
该函数适用于内层查询和外层查询。
版本2.6.0.x后支持
- **LENGTH**
```
SELECT LENGTH(str|column) FROM { tb_name | stb_name } [WHERE clause]
```
功能说明:以字节计数的字符串长度。
返回结果类型:INT。
适用数据类型:输入参数是BINARY类型或者NCHAR类型的字符串或者列。不能应用在TAG列。
说明:
如果输入值为NULL,输出值为NULL。
该函数可以应用在普通表和超级表上。
该函数适用于内层查询和外层查询。
版本2.6.0.x后支持
- **CHAR_LENGTH**
```
SELECT CHAR_LENGTH(str|column) FROM { tb_name | stb_name } [WHERE clause]
```
功能说明:以字符计数的字符串长度。
返回结果类型:INT。
适用数据类型:输入参数是BINARY类型或者NCHAR类型的字符串或者列。不能应用在TAG列。
说明:
如果输入值为NULL,输出值为NULL。
该函数可以应用在普通表和超级表上。
该函数适用于内层查询和外层查询。
版本2.6.0.x后支持
- **LOWER**
```
SELECT LOWER(str|column) FROM { tb_name | stb_name } [WHERE clause]
```
功能说明:将字符串参数值转换为全小写字母。
返回结果类型:同输入类型。
适用数据类型:输入参数是BINARY类型或者NCHAR类型的字符串或者列。不能应用在TAG列。
说明:
如果输入值为NULL,输出值为NULL。
该函数可以应用在普通表和超级表上。
该函数适用于内层查询和外层查询。
版本2.6.0.x后支持
- **UPPER**
```
SELECT UPPER(str|column) FROM { tb_name | stb_name } [WHERE clause]
```
功能说明:将字符串参数值转换为全大写字母。
返回结果类型:同输入类型。
适用数据类型:输入参数是BINARY类型或者NCHAR类型的字符串或者列。不能应用在TAG列。
说明:
如果输入值为NULL,输出值为NULL。
该函数可以应用在普通表和超级表上。
该函数适用于内层查询和外层查询。
版本2.6.0.x后支持
- **LTRIM**
```
SELECT LTRIM(str|column) FROM { tb_name | stb_name } [WHERE clause]
```
功能说明:返回清除左边空格后的字符串。
返回结果类型:同输入类型。
适用数据类型:输入参数是BINARY类型或者NCHAR类型的字符串或者列。不能应用在TAG列。
说明:
如果输入值为NULL,输出值为NULL。
该函数可以应用在普通表和超级表上。
该函数适用于内层查询和外层查询。
版本2.6.0.x后支持
- **RTRIM**
```
SELECT RTRIM(str|column) FROM { tb_name | stb_name } [WHERE clause]
```
功能说明:返回清除右边空格后的字符串。
返回结果类型:同输入类型。
适用数据类型:输入参数是BINARY类型或者NCHAR类型的字符串或者列。不能应用在TAG列。
说明:
如果输入值为NULL,输出值为NULL。
该函数可以应用在普通表和超级表上。
该函数适用于内层查询和外层查询。
版本2.6.0.x后支持
- **SUBSTR**
```
SELECT SUBSTR(str,pos[,len]) FROM { tb_name | stb_name } [WHERE clause]
```
功能说明:从源字符串str中的指定位置pos开始取一个长度为len的子串并返回。
返回结果类型:同输入类型。
适用数据类型:输入参数是BINARY类型或者NCHAR类型的字符串或者列。不能应用在TAG列。
说明:
如果输入值为NULL,输出值为NULL。
输入参数pos可以为正数,也可以为负数。如果pos是正数,表示从开始往后抽取子串。如果pos为负数,表示从结尾往前抽取字符串。如果输入参数len被忽略,返回的子串包含从pos开始的整个字串。
该函数可以应用在普通表和超级表上。
该函数适用于内层查询和外层查询。
版本2.6.0.x后支持
- **四则运算**
```mysql
......
......@@ -1296,6 +1296,412 @@ TDengine supports aggregations over data, they are listed below:
Query OK, 1 row(s) in set (0.000836s)
```
- **ASIN**
```mysql
SELECT ASIN(field_name) FROM { tb_name | stb_name } [WHERE clause]
```
Function: Returns the arc-sine of the input value.
Output Data Type: DOUBLE.
Input: applies to value of all types except timestamp, binary, nchar, and bool. Can not apply to tag column of super table.
Embedded Query Support: Both Outer Query and Inner Query
Notes:
If input value is NULL, the output value is NULL.
It is a scalar function and can not be used together with aggregate function
Applies to columns of normal table, child table and super table
Supported after version 2.6.0.x
- **ACOS**
```mysql
SELECT ACOS(field_name) FROM { tb_name | stb_name } [WHERE clause]
```
Function: Returns the arc-cosine of the input value.
Output Data Type: DOUBLE.
Input: applies to value of all types except timestamp, binary, nchar, and bool. Can not apply to tag column of super table.
Embedded Query Support: Both Outer Query and Inner Query
Notes:
If input value is NULL, the output value is NULL.
It is a scalar function and can not be used together with aggregate function
Applies to columns of normal table, child table and super table
Supported after version 2.6.0.x
- **ATAN**
```mysql
SELECT ATAN(field_name) FROM { tb_name | stb_name } [WHERE clause]
```
Function: Returns the arc-tangent of the input value.
Output Data Type: DOUBLE.
Input: applies to value of all types except timestamp, binary, nchar, and bool. Can not apply to tag column of super table.
Embedded Query Support: Both Outer Query and Inner Query
Notes:
If input value is NULL, the output value is NULL.
It is a scalar function and can not be used together with aggregate function
Applies to columns of normal table, child table and super table
Supported after version 2.6.0.x
- **SIN**
```mysql
SELECT SIN(field_name) FROM { tb_name | stb_name } [WHERE clause]
```
Function: Returns the sine of the input value.
Output Data Type: DOUBLE.
Input: applies to value of all types except timestamp, binary, nchar, and bool. Can not apply to tag column of super table.
Embedded Query Support: Both Outer Query and Inner Query
Notes:
If input value is NULL, the output value is NULL.
It is a scalar function and can not be used together with aggregate function
Applies to columns of normal table, child table and super table
Supported after version 2.6.0.x
- **COS**
```mysql
SELECT COS(field_name) FROM { tb_name | stb_name } [WHERE clause]
```
Function: Returns the cosine of the input value.
Output Data Type: DOUBLE.
Input: applies to value of all types except timestamp, binary, nchar, and bool. Can not apply to tag column of super table.
Embedded Query Support: Both Outer Query and Inner Query
Notes:
If input value is NULL, the output value is NULL.
It is a scalar function and can not be used together with aggregate function
Applies to columns of normal table, child table and super table
Supported after version 2.6.0.x
- **TAN**
```mysql
SELECT TAN(field_name) FROM { tb_name | stb_name } [WHERE clause]
```
Function: Returns the tangent of the input value.
Output Data Type: DOUBLE.
Input: applies to value of all types except timestamp, binary, nchar, and bool. Can not apply to tag column of super table.
Embedded Query Support: Both Outer Query and Inner Query
Notes:
If input value is NULL, the output value is NULL.
It is a scalar function and can not be used together with aggregate function
Applies to columns of normal table, child table and super table
Supported after version 2.6.0.x
- **POW**
```mysql
SELECT POW(field_name, power) FROM { tb_name | stb_name } [WHERE clause]
```
Function: Returns the input value raised to the specified power of the second argument
Output Data Type: DOUBLE.
Input: applies to value of all types except timestamp, binary, nchar, and bool. Can not apply to tag column of super table.
Embedded Query Support: Both Outer Query and Inner Query
Notes:
If input value is NULL, the output value is NULL.
It is a scalar function and can not be used together with aggregate function
Applies to columns of normal table, child table and super table
Supported after version 2.6.0.x
- **LOG**
```mysql
SELECT LOG(field_name, base) FROM { tb_name | stb_name } [WHERE clause]
```
Function: Returns the logarithm of the input value with base
Output Data Type: DOUBLE.
Input: applies to value of all types except timestamp, binary, nchar, and bool. Can not apply to tag column of super table.
Embedded Query Support: Both Outer Query and Inner Query
Notes:
If input value is NULL, the output value is NULL.
It is a scalar function and can not be used together with aggregate function
Applies to columns of normal table, child table and super table
Supported after version 2.6.0.x
- **ABS**
```mysql
SELECT ABS(field_name) FROM { tb_name | stb_name } [WHERE clause]
```
Function: Returns the absolute value of the input value
Output Data Type: If the input data is an integer numeric value, the output data type is ubigint. If the input data is a float or double value, the output data type is double
Input: applies to value of all types except timestamp, binary, nchar, and bool. Can not apply to tag column of super table.
Embedded Query Support: Both Outer Query and Inner Query
Notes:
If input value is NULL, the output value is NULL.
It is a scalar function and can not be used together with aggregate function
Applies to columns of normal table, child table and super table
Supported after version 2.6.0.x
- **SQRT**
```mysql
SELECT SQRT(field_name) FROM { tb_name | stb_name } [WHERE clause]
```
Function: Returns the square root value of the input value
Output Data Type: DOUBLE.
Input: applies to value of all types except timestamp, binary, nchar, and bool. Can not apply to tag column of super table.
Embedded Query Support: Both Outer Query and Inner Query
Notes:
If input value is NULL, the output value is NULL.
It is a scalar function and can not be used together with aggregate function
Applies to columns of normal table, child table and super table
Supported after version 2.6.0.x
- **CAST**
```mysql
SELECT CAST(expression AS type_name) FROM { tb_name | stb_name } [WHERE clause]
```
Function: Converts a value into as a specific data type of type_name.
Output Data Type: type_name specificied. Supported types include BIGINT, BINARY(N), TIMESTAMP and NCHAR(N) and BIGINT UNSIGNED
Input: Normal column, constant, scalar function and the arithmetic computation(+,-,*,/,%) among them. Input data type includes BOOL, TINYINT, SMALLINT, INT, BIGINT, FLOAT, DOUBLE, BINARY(M), TIMESTAMP, NCHAR(M), TINYINT UNSIGNED, SMALLINT UNSIGNED, INT UNSIGNED, and BIGINT UNSIGNED
Notes:
Reports error for unsupported cast
It is a scalar function and its output is NULL for input NULL
Supported after version 2.6.0.x
- **CONCAT**
```mysql
SELECT CONCAT(str1|column1, str2|column2, ...) FROM { tb_name | stb_name } [WHERE clause]
```
Function: Returns the string from concatenating the arguments
Output Data Type: With binary inputs, the output data type is binary. With nchar inputs, the output data type is nchar.
Input: all inputs shall be of data type binary or nchar. Can not apply to tag columns.
Notes:
If one of the string inputs is NULL, the resulting output is NULL.
The function takes 2 to 8 string values as input. all inputs must be of the same data type.
This function applies to normal table, child table and super table
This function applies to bother out query and inner query
Supported after version 2.6.0.x
- **CONCAT_WS**
```
SELECT CONCAT_WS(separator, str1|column1, str2|column2, ...) FROM { tb_name | stb_name } [WHERE clause]
```
Function: Returns the string from concatenating the arguments with separator.
Output Data Type: With binary inputs, the output data type is binary. With nchar inputs, the output data type is nchar.
Input: all inputs shall be of data type binary or nchar. Can not apply to tag columns.
Notes:
Returns NULL when the separator is NULL. If the separator is not NULL and all the other string values are NULL, the result is an empty string.
The function takes 3 to 9 string values as input. all inputs must be of the same data type.
This function applies to normal table, child table and super table
This function applies to bother out query and inner query
Supported after version 2.6.0.x
- **LENGTH**
```
SELECT LENGTH(str|column) FROM { tb_name | stb_name } [WHERE clause]
```
Function: Returns the length of the string measure in bytes
Output Data Type: INT。
Input: BINARY or NCHAR values. Can not apply to tag columns
Notes:
Returns NULL when input is NULL.
This function applies to normal table, child table and super table
This function applies to bother out query and inner query
Supported after version 2.6.0.x
- **CHAR_LENGTH**
```
SELECT CHAR_LENGTH(str|column) FROM { tb_name | stb_name } [WHERE clause]
```
Function: Returns the length of the string measure in characters
Output Data Type: INT。
Input: BINARY or NCHAR values. Can not apply to tag columns
Notes:
Returns NULL when input is NULL.
This function applies to normal table, child table and super table
This function applies to bother out query and inner query
Supported after version 2.6.0.x
- **LOWER**
```
SELECT LOWER(str|column) FROM { tb_name | stb_name } [WHERE clause]
```
Function: Returns the lower case of input value
Output Data Type: BINARY or NCHAR. Same data type as Input.
Input: BINARY or NCHAR values. Can not apply to tag columns
Notes:
Returns NULL when input is NULL.
This function applies to normal table, child table and super table
This function applies to bother out query and inner query
Supported after version 2.6.0.x
- **UPPER**
```
SELECT UPPER(str|column) FROM { tb_name | stb_name } [WHERE clause]
```
Function: Returns the upper case of input value
Output Data Type: BINARY or NCHAR. Same data type as Input.
Input: BINARY or NCHAR values. Can not apply to tag columns
Notes:
Returns NULL when input is NULL.
This function applies to normal table, child table and super table
This function applies to bother out query and inner query
Supported after version 2.6.0.x
- **LTRIM**
```
SELECT LTRIM(str|column) FROM { tb_name | stb_name } [WHERE clause]
```
Function: removes leading spaces from a string
Output Data Type: BINARY or NCHAR. Same data type as Input.
Input: BINARY or NCHAR values. Can not apply to tag columns
Notes:
Returns NULL when input is NULL.
This function applies to normal table, child table and super table
This function applies to bother out query and inner query
Supported after version 2.6.0.x
- **RTRIM**
```
SELECT RTRIM(str|column) FROM { tb_name | stb_name } [WHERE clause]
```
Function: removes trailing spaces from a string
Output Data Type: BINARY or NCHAR. Same data type as Input.
Input: BINARY or NCHAR values. Can not apply to tag columns
Notes:
Returns NULL when input is NULL.
This function applies to normal table, child table and super table
This function applies to bother out query and inner query
Supported after version 2.6.0.x
- **SUBSTR**
```
SELECT SUBSTR(str,pos[,len]) FROM { tb_name | stb_name } [WHERE clause]
```
Function: extracts substring from a string str, starting from pos and extracting len characters.
Output Data Type: BINARY or NCHAR. Same data type as Input.
Input: BINARY or NCHAR values. Can not apply to tag columns
Notes:
Returns NULL when input is NULL.
Input pos can be negative or positive. If it is a positive number, this function extracts from the beginning of the string. If it is a negative number, this function extracts from the end of the string
If input len is ommited, the output is whole substring starting from pos.
This function applies to normal table, child table and super table
This function applies to bother out query and inner query
Supported after version 2.6.0.x
- **Four Operations**
```mysql
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册