-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
55 additions
and
6 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
docs/MatrixOne/Reference/Functions-and-Operators/Vector/subvector.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# SUBVECTOR() | ||
|
||
## 函数说明 | ||
|
||
`SUBVECTOR()` 函数用于从向量中提取子向量。 | ||
|
||
## 函数语法 | ||
|
||
``` | ||
> SUBVECTOR(vec, pos, len) | ||
``` | ||
|
||
## 参数释义 | ||
|
||
| 参数 | 说明 | | ||
| ---- | ---- | | ||
|vec | 必需参数。从中提取子向量的源向量| | ||
|pos | 必需参数。开始提取的位置。向量中的第一个位置是 1,如果 pos 为正,则函数从向量的开头提取。如果 pos 为负,则提取是从向量的末尾开始。| | ||
|len | 可选参数。要提取的维度数。默认从位置 pos 开始到向量末尾的子向量。如果 len 小于 1,则返回空向量。 | | ||
|
||
## 示例 | ||
|
||
```sql | ||
mysql> SELECT SUBVECTOR("[1,2,3]", 2); | ||
+-----------------------+ | ||
| subvector([1,2,3], 2) | | ||
+-----------------------+ | ||
| [2, 3] | | ||
+-----------------------+ | ||
1 row in set (0.01 sec) | ||
|
||
mysql> SELECT SUBVECTOR("[1,2,3]",-1,1); | ||
+---------------------------+ | ||
| subvector([1,2,3], -1, 1) | | ||
+---------------------------+ | ||
| [3] | | ||
+---------------------------+ | ||
1 row in set (0.00 sec) | ||
|
||
mysql> SELECT SUBVECTOR("[1,2,3]",-1,0); | ||
+---------------------------+ | ||
| subvector([1,2,3], -1, 0) | | ||
+---------------------------+ | ||
| [] | | ||
+---------------------------+ | ||
1 row in set (0.00 sec) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters