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
-`expression`: Required. The column or expression to return the first value from
29
-
-`PARTITION BY`: Optional. Divides rows into partitions
30
-
-`ORDER BY`: Required. Determines the ordering within the window
31
-
-`window_frame`: Optional. Defines the window frame (default: RANGE UNBOUNDED PRECEDING)
28
+
-`expression`: Required. The column or expression to return the first value from.
29
+
-`PARTITION BY`: Optional. Divides rows into partitions.
30
+
-`ORDER BY`: Required. Determines the ordering within the window.
31
+
-`window_frame`: Optional. Defines the window frame. The default is `RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW`.
32
32
33
33
**Notes:**
34
-
- Returns the first value in the ordered window frame
35
-
- Supports `IGNORE NULLS` and `RESPECT NULLS` options
36
-
- Useful for finding the earliest/lowest value in each group
34
+
- Returns the first value in the ordered window frame.
35
+
- Supports `IGNORE NULLS` to skip null values and `RESPECT NULLS` to keep the default behaviour.
36
+
- Specify an explicit window frame (for example, `ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW`) when you need row-based semantics instead of the default range frame.
37
+
- Useful for finding the earliest or lowest value in each group or time window.
-`expression`: Required. The column or expression to return the last value from
29
-
-`PARTITION BY`: Optional. Divides rows into partitions
30
-
-`ORDER BY`: Required. Determines the ordering within the window
31
-
-`window_frame`: Optional. Defines the window frame (default: RANGE UNBOUNDED PRECEDING)
28
+
-`expression`: Required. The column or expression to return the last value from.
29
+
-`PARTITION BY`: Optional. Divides rows into partitions.
30
+
-`ORDER BY`: Required. Determines the ordering within the window.
31
+
-`window_frame`: Optional. Defines the window frame. The default is `RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW`.
32
32
33
33
**Notes:**
34
-
- Returns the last value in the ordered window frame
35
-
- Supports `IGNORE NULLS` and `RESPECT NULLS`options
36
-
-Often requires explicit window frame to get expected results
37
-
- Useful for finding the latest/highest value in each group
34
+
- Returns the last value in the ordered window frame.
35
+
- Supports `IGNORE NULLS`to skip null values and `RESPECT NULLS`to keep the default behaviour.
36
+
-Use a frame that ends after the current row (for example, `ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING`) when you need the true last row of a partition.
37
+
- Useful for finding the latest value in each group, or the most recent value inside a look-ahead window.
0 commit comments