diff --git a/docs/en/sql-reference/10-sql-commands/00-ddl/04-task/01-ddl-create_task.md b/docs/en/sql-reference/10-sql-commands/00-ddl/04-task/01-ddl-create_task.md index ba6eebf1ab..8e0333d016 100644 --- a/docs/en/sql-reference/10-sql-commands/00-ddl/04-task/01-ddl-create_task.md +++ b/docs/en/sql-reference/10-sql-commands/00-ddl/04-task/01-ddl-create_task.md @@ -5,7 +5,7 @@ sidebar_position: 1 import FunctionDescription from '@site/src/components/FunctionDescription'; - + The CREATE TASK statement is used to define a new task that executes a specified SQL statement on a scheduled basis or dag based task graph. @@ -14,7 +14,7 @@ The CREATE TASK statement is used to define a new task that executes a specified ## Syntax ```sql -CREATE TASK [ IF NOT EXISTS ] +CREATE [ OR REPLACE ] TASK [ IF NOT EXISTS ] WAREHOUSE = SCHEDULE = { MINUTE | SECOND | USING CRON } [ AFTER [ , , ... ]] diff --git a/docs/en/sql-reference/10-sql-commands/10-dml/dml-insert-multi.md b/docs/en/sql-reference/10-sql-commands/10-dml/dml-insert-multi.md index 222511f911..7217e16521 100644 --- a/docs/en/sql-reference/10-sql-commands/10-dml/dml-insert-multi.md +++ b/docs/en/sql-reference/10-sql-commands/10-dml/dml-insert-multi.md @@ -50,13 +50,12 @@ SELECT ... | Parameter | Description | | ---------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| OVERWRITE | Indicates whether existing data should be truncated before insertion. | +| `OVERWRITE` | Indicates whether existing data should be truncated before insertion. | | `( [ , ... ] )` | Specifies the column names in the target table where data will be inserted.
- If omitted, data will be inserted into all columns in the target table. | -| VALUES `( [ , ... ] )` | Specifies the source column names from which data will be inserted into the target table.
- If omitted, all columns returned by the subquery will be inserted into the target table.
- The data types of the columns listed in `` must match or be compatible with those specified in ``. | -| SELECT ... | A subquery that provides the data to be inserted into the target table(s).
- You have the option to explicitly assign aliases to columns within the subquery. This allows you to reference the columns by their aliases within WHEN clauses and VALUES clauses. | -| WHEN | Conditional statement to determine when to insert data into specific target tables.
- A conditional multi-table insert requires at least one WHEN clause.
- A WHEN clause can include multiple INTO clauses, and these INTO clauses can target the same table.
- To unconditionally execute a WHEN clause, you can use `WHEN 1 THEN ...`. | -| ELSE | Specifies the action to take if none of the conditions specified in the WHEN clauses are met. | - +| `VALUES ( [ , ... ] )` | Specifies the source column names from which data will be inserted into the target table.
- If omitted, all columns returned by the subquery will be inserted into the target table.
- The data types of the columns listed in `` must match or be compatible with those specified in ``. | +| `SELECT ...` | A subquery that provides the data to be inserted into the target table(s).
- You have the option to explicitly assign aliases to columns within the subquery. This allows you to reference the columns by their aliases within WHEN clauses and VALUES clauses. | +| `WHEN` | Conditional statement to determine when to insert data into specific target tables.
- A conditional multi-table insert requires at least one WHEN clause.
- A WHEN clause can include multiple INTO clauses, and these INTO clauses can target the same table.
- To unconditionally execute a WHEN clause, you can use `WHEN 1 THEN ...`. | +| `ELSE` | Specifies the action to take if none of the conditions specified in the WHEN clauses are met. | ## Important Notes - Aggregate functions, external UDFs, and window functions are not allowed in the `VALUES(...)` expressions. diff --git a/docs/en/sql-reference/10-sql-commands/10-dml/dml-insert.md b/docs/en/sql-reference/10-sql-commands/10-dml/dml-insert.md index 8b997b3557..1a57ea9e12 100644 --- a/docs/en/sql-reference/10-sql-commands/10-dml/dml-insert.md +++ b/docs/en/sql-reference/10-sql-commands/10-dml/dml-insert.md @@ -1,6 +1,9 @@ --- title: INSERT --- +import FunctionDescription from '@site/src/components/FunctionDescription'; + + Inserts one or more rows into a table. @@ -13,7 +16,7 @@ See also: [INSERT (multi-table)](dml-insert-multi.md) ## Syntax ```sql -INSERT { OVERWRITE | INTO } +INSERT { OVERWRITE [ INTO ] | INTO }
-- Optionally specify the columns to insert into ( [ , ... ] ) -- Insertion options: @@ -25,10 +28,10 @@ INSERT { OVERWRITE | INTO }
} ``` -| Parameter | Description | -|-----------|----------------------------------------------------------------------------------| -| OVERWRITE | Indicates whether existing data should be truncated before insertion. | -| VALUES | Allows direct insertion of specific values or the default values of the columns. | +| Parameter | Description | +|--------------------|----------------------------------------------------------------------------------| +| `OVERWRITE [INTO]` | Indicates whether existing data should be truncated before insertion. | +| `VALUES` | Allows direct insertion of specific values or the default values of the columns. | ## Important Notes diff --git a/docs/en/sql-reference/20-sql-functions/03-conditional-functions/greatest-ignore-nulls.md b/docs/en/sql-reference/20-sql-functions/03-conditional-functions/greatest-ignore-nulls.md new file mode 100644 index 0000000000..dc826f8b6d --- /dev/null +++ b/docs/en/sql-reference/20-sql-functions/03-conditional-functions/greatest-ignore-nulls.md @@ -0,0 +1,30 @@ +--- +title: GREATEST_IGNORE_NULLS +--- +import FunctionDescription from '@site/src/components/FunctionDescription'; + + + +Returns the maximum value from a set of values, ignoring any NULL values. + +See also: [GREATEST](greatest.md) + +## Syntax + +```sql +GREATEST_IGNORE_NULLS(, ...) +``` + +## Examples + +```sql +SELECT GREATEST_IGNORE_NULLS(5, 9, 4), GREATEST_IGNORE_NULLS(5, 9, null); +``` + +```sql +┌────────────────────────────────────────────────────────────────────┐ +│ greatest_ignore_nulls(5, 9, 4) │ greatest_ignore_nulls(5, 9, NULL) │ +├────────────────────────────────┼───────────────────────────────────┤ +│ 9 │ 9 │ +└────────────────────────────────────────────────────────────────────┘ +``` \ No newline at end of file diff --git a/docs/en/sql-reference/20-sql-functions/03-conditional-functions/greatest.md b/docs/en/sql-reference/20-sql-functions/03-conditional-functions/greatest.md index cabdde5eb1..2685312c2a 100644 --- a/docs/en/sql-reference/20-sql-functions/03-conditional-functions/greatest.md +++ b/docs/en/sql-reference/20-sql-functions/03-conditional-functions/greatest.md @@ -1,8 +1,13 @@ --- title: GREATEST --- +import FunctionDescription from '@site/src/components/FunctionDescription'; -Returns the maximum value from a set of values. + + +Returns the maximum value from a set of values. If any value in the set is `NULL`, the function returns `NULL`. + +See also: [GREATEST_IGNORE_NULLS](greatest-ignore-nulls.md) ## Syntax @@ -13,11 +18,13 @@ GREATEST(, ...) ## Examples ```sql -SELECT GREATEST(5, 9, 4); +SELECT GREATEST(5, 9, 4), GREATEST(5, 9, null); +``` -┌───────────────────┐ -│ greatest(5, 9, 4) │ -├───────────────────┤ -│ 9 │ -└───────────────────┘ +```sql +┌──────────────────────────────────────────┐ +│ greatest(5, 9, 4) │ greatest(5, 9, NULL) │ +├───────────────────┼──────────────────────┤ +│ 9 │ NULL │ +└──────────────────────────────────────────┘ ``` \ No newline at end of file diff --git a/docs/en/sql-reference/20-sql-functions/03-conditional-functions/if.md b/docs/en/sql-reference/20-sql-functions/03-conditional-functions/if.md index 142822dcf9..0836e6313d 100644 --- a/docs/en/sql-reference/20-sql-functions/03-conditional-functions/if.md +++ b/docs/en/sql-reference/20-sql-functions/03-conditional-functions/if.md @@ -1,6 +1,9 @@ --- title: IF --- +import FunctionDescription from '@site/src/components/FunctionDescription'; + + If `` is TRUE, it returns ``. Otherwise if `` is TRUE, it returns ``, and so on. @@ -10,6 +13,10 @@ If `` is TRUE, it returns ``. Otherwise if `` is TRUE, it r IF(, , [, ...], ) ``` +## Aliases + +- [IFF](iff.md) + ## Examples ```sql diff --git a/docs/en/sql-reference/20-sql-functions/03-conditional-functions/iff.md b/docs/en/sql-reference/20-sql-functions/03-conditional-functions/iff.md new file mode 100644 index 0000000000..b32d3ff388 --- /dev/null +++ b/docs/en/sql-reference/20-sql-functions/03-conditional-functions/iff.md @@ -0,0 +1,8 @@ +--- +title: IFF +--- +import FunctionDescription from '@site/src/components/FunctionDescription'; + + + +Alias for [IF](if.md). \ No newline at end of file diff --git a/docs/en/sql-reference/20-sql-functions/03-conditional-functions/least-ignore-nulls.md b/docs/en/sql-reference/20-sql-functions/03-conditional-functions/least-ignore-nulls.md new file mode 100644 index 0000000000..08479ca6cd --- /dev/null +++ b/docs/en/sql-reference/20-sql-functions/03-conditional-functions/least-ignore-nulls.md @@ -0,0 +1,30 @@ +--- +title: LEAST_IGNORE_NULLS +--- +import FunctionDescription from '@site/src/components/FunctionDescription'; + + + +Returns the maximum value from a set of values, ignoring any NULL values. + +See also: [LEAST](least.md) + +## Syntax + +```sql +LEAST_IGNORE_NULLS(, ...) +``` + +## Examples + +```sql +SELECT LEAST_IGNORE_NULLS(5, 9, 4), LEAST_IGNORE_NULLS(5, 9, null); +``` + +```sql +┌──────────────────────────────────────────────────────────────┐ +│ least_ignore_nulls(5, 9, 4) │ least_ignore_nulls(5, 9, NULL) │ +├─────────────────────────────┼────────────────────────────────┤ +│ 4 │ 5 │ +└──────────────────────────────────────────────────────────────┘ +``` \ No newline at end of file diff --git a/docs/en/sql-reference/20-sql-functions/03-conditional-functions/least.md b/docs/en/sql-reference/20-sql-functions/03-conditional-functions/least.md index fc17340712..7d1a2c06b4 100644 --- a/docs/en/sql-reference/20-sql-functions/03-conditional-functions/least.md +++ b/docs/en/sql-reference/20-sql-functions/03-conditional-functions/least.md @@ -1,8 +1,13 @@ --- title: LEAST --- +import FunctionDescription from '@site/src/components/FunctionDescription'; -Returns the minimum value from a set of values. + + +Returns the minimum value from a set of values. If any value in the set is `NULL`, the function returns `NULL`. + +See also: [LEAST_IGNORE_NULLS](least-ignore-nulls.md) ## Syntax @@ -13,11 +18,13 @@ LEAST(, ...) ## Examples ```sql -SELECT LEAST(5, 9, 4); +SELECT LEAST(5, 9, 4), LEAST(5, 9, null); +``` -┌────────────────┐ -│ least(5, 9, 4) │ -├────────────────┤ -│ 4 │ -└────────────────┘ +``` +┌────────────────────────────────────┐ +│ least(5, 9, 4) │ least(5, 9, NULL) │ +├────────────────┼───────────────────┤ +│ 4 │ NULL │ +└────────────────────────────────────┘ ``` \ No newline at end of file diff --git a/docs/en/sql-reference/20-sql-functions/07-aggregate-functions/aggregate-covar-pop.md b/docs/en/sql-reference/20-sql-functions/07-aggregate-functions/aggregate-covar-pop.md index 71ea77e65b..a3b4b334b9 100644 --- a/docs/en/sql-reference/20-sql-functions/07-aggregate-functions/aggregate-covar-pop.md +++ b/docs/en/sql-reference/20-sql-functions/07-aggregate-functions/aggregate-covar-pop.md @@ -1,8 +1,11 @@ --- title: COVAR_POP --- +import FunctionDescription from '@site/src/components/FunctionDescription'; -COVAR_POP returns the population covariance of a set of number pairs. + + +Returns the population covariance of a set of number pairs. ## Syntax @@ -17,6 +20,11 @@ COVAR_POP(, ) | `` | Any numerical expression | | `` | Any numerical expression | +## Aliases + +- [VAR_POP](aggregate-var-pop.md) +- [VARIANCE_POP](aggregate-variance-pop.md) + ## Return Type float64 diff --git a/docs/en/sql-reference/20-sql-functions/07-aggregate-functions/aggregate-covar-samp.md b/docs/en/sql-reference/20-sql-functions/07-aggregate-functions/aggregate-covar-samp.md index d7ad04fba8..31881f7d28 100644 --- a/docs/en/sql-reference/20-sql-functions/07-aggregate-functions/aggregate-covar-samp.md +++ b/docs/en/sql-reference/20-sql-functions/07-aggregate-functions/aggregate-covar-samp.md @@ -2,9 +2,11 @@ title: COVAR_SAMP --- -Aggregate function. +import FunctionDescription from '@site/src/components/FunctionDescription'; -The covar_samp() function returns the sample covariance (Σ((x - x̅)(y - y̅)) / (n - 1)) of two data columns. + + +Returns the sample covariance (Σ((x - x̅)(y - y̅)) / (n - 1)) of two data columns. :::caution NULL values are not counted. @@ -23,6 +25,11 @@ COVAR_SAMP(, ) | `` | Any numerical expression | | `` | Any numerical expression | +## Aliases + +- [VAR_SAMP](aggregate-var-samp.md) +- [VARIANCE_SAMP](aggregate-variance-samp.md) + ## Return Type float64, when `n <= 1`, returns +∞. diff --git a/docs/en/sql-reference/20-sql-functions/07-aggregate-functions/aggregate-var-pop.md b/docs/en/sql-reference/20-sql-functions/07-aggregate-functions/aggregate-var-pop.md new file mode 100644 index 0000000000..8c770e771f --- /dev/null +++ b/docs/en/sql-reference/20-sql-functions/07-aggregate-functions/aggregate-var-pop.md @@ -0,0 +1,8 @@ +--- +title: VAR_POP +--- +import FunctionDescription from '@site/src/components/FunctionDescription'; + + + +Alias for [COVAR_POP](aggregate-covar-pop.md). \ No newline at end of file diff --git a/docs/en/sql-reference/20-sql-functions/07-aggregate-functions/aggregate-var-samp.md b/docs/en/sql-reference/20-sql-functions/07-aggregate-functions/aggregate-var-samp.md new file mode 100644 index 0000000000..e4f84f2322 --- /dev/null +++ b/docs/en/sql-reference/20-sql-functions/07-aggregate-functions/aggregate-var-samp.md @@ -0,0 +1,9 @@ +--- +title: VAR_SAMP +--- + +import FunctionDescription from '@site/src/components/FunctionDescription'; + + + +Alias for [COVAR_SAMP](aggregate-covar-samp.md). \ No newline at end of file diff --git a/docs/en/sql-reference/20-sql-functions/07-aggregate-functions/aggregate-variance-pop.md b/docs/en/sql-reference/20-sql-functions/07-aggregate-functions/aggregate-variance-pop.md new file mode 100644 index 0000000000..ae8f5e9e1b --- /dev/null +++ b/docs/en/sql-reference/20-sql-functions/07-aggregate-functions/aggregate-variance-pop.md @@ -0,0 +1,8 @@ +--- +title: VARIANCE_POP +--- +import FunctionDescription from '@site/src/components/FunctionDescription'; + + + +Alias for [COVAR_POP](aggregate-covar-pop.md). \ No newline at end of file diff --git a/docs/en/sql-reference/20-sql-functions/07-aggregate-functions/aggregate-variance-samp.md b/docs/en/sql-reference/20-sql-functions/07-aggregate-functions/aggregate-variance-samp.md new file mode 100644 index 0000000000..f3050aa861 --- /dev/null +++ b/docs/en/sql-reference/20-sql-functions/07-aggregate-functions/aggregate-variance-samp.md @@ -0,0 +1,9 @@ +--- +title: VARIANCE_SAMP +--- + +import FunctionDescription from '@site/src/components/FunctionDescription'; + + + +Alias for [COVAR_SAMP](aggregate-covar-samp.md). \ No newline at end of file