This repository has been archived by the owner on Dec 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
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
48 additions
and
13 deletions.
There are no files selected for viewing
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,29 @@ | ||
## 动态查询嵌入语法 | ||
|
||
内容块动态查询嵌入的语法是: | ||
|
||
```sql | ||
!{{ SELECT * FROM blocks WHERE content LIKE '%内容块%' }} | ||
``` | ||
|
||
需要独占一行使用。使用的脚本语法是 SQL,具体细节请参考((20201117103851-l9cahuc "这里"))。 | ||
|
||
### 示例 | ||
|
||
* 查询内容中包含 `内容块` 的列表项: | ||
|
||
```sql | ||
!{{ SELECT * FROM blocks WHERE content LIKE '%内容块%' AND type = 'NodeListItem' }} | ||
``` | ||
|
||
* 查询内容中同时包含 `内容块` 和 `引用` 段落块: | ||
|
||
```sql | ||
!{{ SELECT * FROM blocks WHERE content LIKE '%内容块%' AND content LIKE '%引用%' }} | ||
``` | ||
|
||
* 查询内容中同时包含 `内容块` 和 `嵌入` 的标题块并按时间降序结果取前 2 条: | ||
|
||
```sql | ||
!{{ SELECT * FROM blocks WHERE (content LIKE '%内容块%' AND content LIKE '%嵌入%') AND type = 'NodeHeading' ORDER BY block_id DESC LIMIT 4 }} | ||
``` |
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