Skip to content

Commit f2f6ff0

Browse files
Merge pull request #29190 from taosdata/docs/TD-33244
docs:[TD-33244] Add version support description to function documenta…
2 parents f9124da + 8fab3e0 commit f2f6ff0

File tree

2 files changed

+106
-4
lines changed

2 files changed

+106
-4
lines changed

docs/en/14-reference/03-taos-sql/10-function.md

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ ROUND(expr[, digits])
190190
- `digits` less than zero means discarding the decimal places and rounding the number to the left of the decimal point by `digits` places. If the number of places to the left of the decimal point is less than `digits`, returns 0.
191191
- Since the DECIMAL type is not yet supported, this function will use DOUBLE and FLOAT to represent results containing decimals, but DOUBLE and FLOAT have precision limits, and using this function may be meaningless when there are too many digits.
192192
- Can only be used with regular columns, selection (Selection), projection (Projection) functions, and cannot be used with aggregation (Aggregation) functions.
193+
- `digits` is supported from version 3.3.3.0.
193194

194195
**Example**:
195196

@@ -249,6 +250,8 @@ TAN(expr)
249250

250251
**Function Description**: Obtains the tangent result of the specified field.
251252

253+
**Version**: ver-3.3.3.0
254+
252255
**Return Result Type**: DOUBLE.
253256

254257
**Applicable Data Types**: Numeric types.
@@ -297,6 +300,8 @@ TRUNCATE(expr, digits)
297300

298301
**Function Description**: Gets the truncated value of the specified field to the specified number of digits.
299302

303+
**Version**: ver-3.3.3.0
304+
300305
**Return Type**: Consistent with the original data type of the `expr` field.
301306

302307
**Applicable Data Types**:
@@ -340,6 +345,8 @@ EXP(expr)
340345

341346
**Function Description**: Returns the value of e (the base of natural logarithms) raised to the specified power.
342347

348+
**Version**: ver-3.3.3.0
349+
343350
**Return Type**: DOUBLE.
344351

345352
**Applicable Data Types**: Numeric type.
@@ -370,6 +377,8 @@ LN(expr)
370377

371378
**Function Description**: Returns the natural logarithm of the specified parameter.
372379

380+
**Version**: ver-3.3.3.0
381+
373382
**Return Type**: DOUBLE.
374383

375384
**Applicable Data Types**: Numeric type.
@@ -401,6 +410,8 @@ MOD(expr1, expr2)
401410

402411
**Function Description**: Calculates the result of expr1 % expr2.
403412

413+
**Version**: ver-3.3.3.0
414+
404415
**Return Type**: DOUBLE.
405416

406417
**Applicable Data Types**: Numeric type.
@@ -437,6 +448,8 @@ RAND([seed])
437448

438449
**Function Description**: Returns a uniformly distributed random number from 0 to 1.
439450

451+
**Version**: ver-3.3.3.0
452+
440453
**Return Result Type**: DOUBLE.
441454

442455
**Applicable Data Types**:
@@ -484,6 +497,8 @@ SIGN(expr)
484497

485498
**Function Description**: Returns the sign of the specified parameter.
486499

500+
**Version**: ver-3.3.3.0
501+
487502
**Return Result Type**: Consistent with the original data type of the specified field.
488503

489504
**Applicable Data Types**: Numeric types.
@@ -527,6 +542,8 @@ DEGREES(expr)
527542

528543
**Function Description**: Calculates the value of the specified parameter converted from radians to degrees.
529544

545+
**Version**: ver-3.3.3.0
546+
530547
**Return Result Type**: DOUBLE.
531548

532549
**Applicable Data Types**: Numeric types.
@@ -558,6 +575,8 @@ RADIANS(expr)
558575

559576
**Function Description**: Calculates the value of the specified parameter converted from degrees to radians.
560577

578+
**Version**: ver-3.3.3.0
579+
561580
**Return Type**: DOUBLE.
562581

563582
**Applicable Data Types**: Numeric types.
@@ -729,6 +748,8 @@ TRIM([remstr FROM] expr)
729748

730749
**Function Description**: Returns the string expr with all prefixes or suffixes of remstr removed.
731750

751+
**Version**: ver-3.3.3.0
752+
732753
**Return Result Type**: Same as the original type of the input field expr.
733754

734755
**Applicable Data Types**:
@@ -807,6 +828,8 @@ SUBSTRING/SUBSTR(expr FROM pos [FOR len])
807828
- If `len` is less than 1, returns an empty string.
808829
- `pos` is 1-based; if `pos` is 0, returns an empty string.
809830
- If `pos` + `len` exceeds `len(expr)`, returns the substring from `pos` to the end of the string, equivalent to executing `substring(expr, pos)`.
831+
- Function `SUBSTRING` is equal to `SUBSTR`, supported from ver-3.3.3.0.
832+
- Syntax `SUBSTRING/SUBSTR(expr FROM pos [FOR len])` is supported from ver-3.3.3.0.
810833

811834
**Examples**:
812835

@@ -845,6 +868,8 @@ SUBSTRING_INDEX(expr, delim, count)
845868

846869
**Function Description**: Returns a substring of `expr` cut at the position where the delimiter appears the specified number of times.
847870

871+
**Version**: ver-3.3.3.0
872+
848873
**Return Result Type**: Same as the original type of the input field `expr`.
849874

850875
**Applicable Data Types**:
@@ -902,6 +927,8 @@ CHAR(expr1 [, expr2] [, expr3] ...)
902927

903928
**Function Description**: Treats the input parameters as integers and returns the characters corresponding to these integers in ASCII encoding.
904929

930+
**Version**: ver-3.3.3.0
931+
905932
**Return Result Type**: VARCHAR.
906933

907934
**Applicable Data Types**: Integer types, VARCHAR, NCHAR.
@@ -949,6 +976,8 @@ ASCII(expr)
949976

950977
**Function Description**: Returns the ASCII code of the first character of the string.
951978

979+
**Version**: ver-3.3.3.0
980+
952981
**Return Result Data Type**: BIGINT.
953982

954983
**Applicable Data Types**: VARCHAR, NCHAR.
@@ -979,6 +1008,8 @@ POSITION(expr1 IN expr2)
9791008

9801009
**Function Description**: Calculates the position of string `expr1` in string `expr2`.
9811010

1011+
**Version**: ver-3.3.3.0
1012+
9821013
**Return Result Type**: BIGINT.
9831014

9841015
**Applicable Data Types**:
@@ -1026,6 +1057,8 @@ REPLACE(expr, from_str, to_str)
10261057

10271058
**Function Description**: Replaces all occurrences of `from_str` in the string with `to_str`.
10281059

1060+
**Version**: ver-3.3.3.0
1061+
10291062
**Return Type**: Same as the original type of the input field `expr`.
10301063

10311064
**Applicable Data Types**:
@@ -1061,6 +1094,8 @@ REPEAT(expr, count)
10611094

10621095
**Function Description**: Returns a string that repeats the string `expr` a specified number of times.
10631096

1097+
**Version**: ver-3.3.3.0
1098+
10641099
**Return Type**: Same as the original type of the input field `expr`.
10651100

10661101
**Applicable Data Types**:
@@ -1319,6 +1354,7 @@ TIMEDIFF(expr1, expr2 [, time_unit])
13191354
- `expr1`: BIGINT, TIMESTAMP types representing timestamps, or VARCHAR, NCHAR types in ISO8601/RFC3339 standard date-time format.
13201355
- `expr2`: BIGINT, TIMESTAMP types representing timestamps, or VARCHAR, NCHAR types in ISO8601/RFC3339 standard date-time format.
13211356
- `time_unit`: See usage instructions.
1357+
- `timediff` return the absolute value of the difference between timestamp `expr1` and `expr2` before ver-3.3.3.0.
13221358

13231359
**Nested Subquery Support**: Applicable to both inner and outer queries.
13241360

@@ -1423,6 +1459,8 @@ WEEK(expr [, mode])
14231459

14241460
**Function Description**: Returns the week number of the input date.
14251461

1462+
**Version**: ver-3.3.3.0
1463+
14261464
**Return Result Type**: BIGINT.
14271465

14281466
**Applicable Data Types**:
@@ -1490,6 +1528,8 @@ WEEKOFYEAR(expr)
14901528

14911529
**Function Description**: Returns the week number of the input date.
14921530

1531+
**Version**: ver-3.3.3.0
1532+
14931533
**Return Type**: BIGINT.
14941534

14951535
**Applicable Data Types**: BIGINT, TIMESTAMP types representing timestamps, or VARCHAR, NCHAR types in ISO8601/RFC3339 date-time format.
@@ -1521,6 +1561,8 @@ WEEKDAY(expr)
15211561

15221562
**Function Description**: Returns the weekday of the input date.
15231563

1564+
**Version**: ver-3.3.3.0
1565+
15241566
**Return Type**: BIGINT.
15251567

15261568
**Applicable Data Types**: BIGINT, TIMESTAMP types representing timestamps, or VARCHAR, NCHAR types in ISO8601/RFC3339 date-time format.
@@ -1552,6 +1594,8 @@ DAYOFWEEK(expr)
15521594

15531595
**Function Description**: Returns the weekday of the input date.
15541596

1597+
**Version**: ver-3.3.3.0
1598+
15551599
**Return Type**: BIGINT.
15561600

15571601
**Applicable Data Types**: BIGINT, TIMESTAMP types representing timestamps, or VARCHAR, NCHAR types in ISO8601/RFC3339 date-time format.
@@ -1707,6 +1751,9 @@ STDDEV/STDDEV_POP(expr)
17071751

17081752
**Applicable to**: Tables and supertables.
17091753

1754+
**Description**:
1755+
- Function `STDDEV_POP` equals `STDDEV` and is supported from ver-3.3.3.0.
1756+
17101757
**Example**:
17111758

17121759
```sql
@@ -1733,6 +1780,8 @@ VAR_POP(expr)
17331780

17341781
**Function Description**: Calculates the population variance of a column in a table.
17351782

1783+
**Version**: ver-3.3.3.0
1784+
17361785
**Return Data Type**: DOUBLE.
17371786

17381787
**Applicable Data Types**: Numeric types.
@@ -1975,7 +2024,8 @@ MAX(expr)
19752024

19762025
**Applicable to**: Tables and supertables.
19772026

1978-
**Usage Instructions**: The max function can accept strings as input parameters, and when the input parameter is a string type, it returns the largest string value.
2027+
**Usage Instructions**:
2028+
- The max function can accept strings as input parameters, and when the input parameter is a string type, it returns the largest string value(supported from ver-3.3.3.0, function `max` only accept numeric parameter before ver-3.3.3.0).
19792029

19802030
### MIN
19812031

@@ -1991,7 +2041,8 @@ MIN(expr)
19912041

19922042
**Applicable to**: Tables and supertables.
19932043

1994-
**Usage Instructions**: The min function can accept strings as input parameters, and when the input parameter is a string type, it returns the largest string value.
2044+
**Usage Instructions**:
2045+
- The min function can accept strings as input parameters, and when the input parameter is a string type, it returns the largest string value(supported from ver-3.3.3.0, function `min` only accept numeric parameter before ver-3.3.3.0).
19952046

19962047
### MODE
19972048

0 commit comments

Comments
 (0)