You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/05-basic/03-query.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -171,7 +171,7 @@ window_clause: {
171
171
When using the window clause, the following rules should be observed. These rules apply to the five window types SESSION, STATE_WINDOW, INTERVAL, EVENT_WINDOW, and COUNT_WINDOW. EXTERNAL_WINDOW has different rules; see the [External Window](#external-window) section for details.
172
172
173
173
1. The window clause is located after the data partitioning clause and cannot be used together with the GROUP BY clause.
174
-
1. The window clause partitions the data by windows and performs calculations on the expressions in the SELECT list for each window. The expressions in the SELECT list can only include: constants; pseudocolumns: \_wstart pseudo-column,\_wend pseudo-column, and \_wduration pseudo-column; aggregate functions (including selection functions and time-series specific functions that can determine the number of output rows by parameters)
174
+
1. The window clause partitions the data by windows and performs calculations on the expressions in the SELECT list for each window. The expressions in the SELECT list can only include: constants; pseudocolumns: \_wstart pseudo-column,\_wend pseudo-column, and \_wduration pseudo-column; aggregate functions (including selection functions, time-series specific functions whose output row count is determined by parameters, and window calculation / time-weighted statistics functions among the time-series specific functions)
175
175
1. WHERE statements can specify the start and end times of the query and other filtering conditions.
-`default_val` must be type-compatible with `expr`.
2814
2814
-`LEAD` is evaluated on the row order of the input result set; you can use `ORDER BY` to change the evaluation order.
2815
2815
- It can be used together with `_rowts`, `tbname`, tag columns, and also in subqueries and `PARTITION BY` scenarios.
2816
-
-Window queries are not supported, such as `INTERVAL`, `SESSION`, and `STATE_WINDOW`.
2816
+
-When used with a window clause, `LEAD` is evaluated only within the current window in window-local row order and does not read rows from the next window.
2817
2817
2818
2818
### MAX
2819
2819
@@ -3135,6 +3135,7 @@ MAVG(expr, k)
3135
3135
3136
3136
- Does not support +, -, *, / operations, such as mavg(col1, k1) + mavg(col2, k1);
3137
3137
- Can only be used with regular columns, selection, and projection functions, not with aggregation functions;
3138
+
- When used with a window clause, `MAVG` is calculated only from samples inside the current window and does not continue state across windows.
3138
3139
3139
3140
### STATECOUNT
3140
3141
@@ -3159,7 +3160,7 @@ STATECOUNT(expr, oper, val)
3159
3160
3160
3161
**Usage Notes**:
3161
3162
3162
-
-Cannot be used with window operations, such as interval/state_window/session_window.
3163
+
-When used with a window clause, `STATECOUNT` counts consecutive records only inside the current window and does not accumulate across windows.
Copy file name to clipboardExpand all lines: docs/en/14-reference/03-taos-sql/24-distinguished.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,7 +67,7 @@ The following rules apply to the five window types SESSION, STATE_WINDOW, INTERV
67
67
- The window clause divides the data by windows and calculates the expressions in the SELECT list for each window. The expressions in the SELECT list can only include:
68
68
- Constants.
69
69
- Pseudocolumns _wstart,_wend, and _wduration.
70
-
- Aggregate functions (including selection functions and time-series specific functions that can determine the number of output rows by parameters).
70
+
- Aggregate functions (including selection functions, time-series specific functions whose output row count is determined by parameters, and window calculation / time-weighted statistics functions among the time-series specific functions).
71
71
- Expressions containing the above expressions.
72
72
- And must include at least one aggregate function(this limitation no longer exists after version 3.4.0.0).
73
73
- The window clause cannot be used together with the GROUP BY clause.
0 commit comments