更新 sql.md

This commit is contained in:
8ga
2026-09-15 11:39:54 +08:00
parent 0aa670000c
commit d3215e4fdc
+16
View File
@@ -44,4 +44,20 @@ where
where
`client_id` = '客户端ID'
);
```
## 查智能体对话日志
1. 查询所有切片号,假设查询出来的`part`是[1,2]
```sql
select part from log_agent_chat where del_flag = '0';
```
2. 根据切片号查询并合并各个切片表的数据
```sql
select * from log_agent_chat_1 where chat_window_id = <ID>
UNION ALL
select * from log_agent_chat_2 where chat_window_id = <ID>
```