提交 d4acd454 编写于 作者: E Elias Soong

[TD-4555] <docs>: add example code about SQL function DERIVATIVE().

上级 7ad60853
......@@ -1285,6 +1285,19 @@ TDengine支持针对数据的聚合查询。提供支持的聚合和选择函数
说明:(从 2.1.3.0 版本开始新增此函数)输出结果行数是范围内总行数减一,第一行没有结果输出。DERIVATIVE 函数可以在由 GROUP BY 划分出单独时间线的情况下用于超级表(也即 GROUP BY tbname)。
示例:
```mysql
taos> select derivative(current, 1d, 0) from t1;
ts | derivative(current, 1d, 0) |
=======================================================
2021-08-20 09:18:44.032 | 119.999966667 |
2021-08-20 10:18:44.032 | -48.000000000 |
2021-08-20 11:18:44.032 | -48.000000000 |
2021-08-20 12:18:44.033 | 215.999940000 |
2021-08-20 13:18:44.034 | -167.999953333 |
Query OK, 5 row(s) in set (0.004772s)
```
- **SPREAD**
```mysql
SELECT SPREAD(field_name) FROM { tb_name | stb_name } [WHERE clause];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册