Skip to content

Commit d671d5a

Browse files
committed
updated sql usage
1 parent f186bda commit d671d5a

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

‎docs/scripts/sql/functions.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
With functions you can transform, calculate, combine or merge the values of other columns from the current table. On top of that, functions can refer to each other. In this article, we will show you a complete overview of all functions with examples. If you are looking for a specific function, you can use Ctrl+F or ⌘+F to quickly find an entry on this page.
44

5-
The functions supported in SQL are roughly the same as the set of functions supported by formulas in SeaTable. The function parameters can be numbers, strings, constants, column names or other functions. Column name cannot be an alias. The function can be classified into the following categories:
5+
The functions supported in SQL are roughly the same as the set of functions supported by formulas in SeaTable. The function parameters can be numbers, strings, constants, column names or other functions. Column name cannot be an alias. The function can be classified into the following categories:
6+
7+
!!! info "Where can functions be used?"
8+
Functions can be used in `SELECT`, `WHERE`, `GROUP BY`, `HAVING`, and `ORDER BY` clauses. They are **not supported** in the `SET` clause of `UPDATE` statements or in the `VALUES` list of `INSERT` statements. Only constant values can be used there.
69

710
- [Operators](#operators)
811
- [Mathematical functions](#mathematical-functions)

‎docs/scripts/sql/introduction.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ Please note that the SQL syntax is case insensitive: we use only upper-cased ins
106106
UPDATE table_name SET column_name = value [, ...] [WhereClause]
107107
```
108108

109+
!!! warning "Only constant values in SET clause"
110+
The `value` in the SET clause must be a **constant** (string, number, or boolean). Functions (e.g. `upper()`, `round()`, `now()`, `if()`), arithmetic expressions (e.g. `Amount + 10`), and column references are **not supported** in the SET clause. Functions and expressions can only be used in `SELECT` and `WHERE` clauses.
111+
109112
- Columns with multiple values, such as "multiple select"-type column , requires values to be surrounded by parentheses, for example: `("foo", "bar")`.
110113
- Values of "single select" and "multiple select"-type columns must be option names, not option keys.
111114
- Few column types are **not allowed** to update:

0 commit comments

Comments
 (0)