Skip to content

Commit 08a66c8

Browse files
authored
updates (#1018)
1 parent 8bd48e1 commit 08a66c8

File tree

3 files changed

+24
-21
lines changed

3 files changed

+24
-21
lines changed

docs/en/sql-reference/20-sql-functions/08-window-functions/first-value.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ title: FIRST_VALUE
44

55
import FunctionDescription from '@site/src/components/FunctionDescription';
66

7-
<FunctionDescription description="Introduced: v1.2.568"/>
7+
<FunctionDescription description="Introduced or updated: v1.2.568"/>
88

9-
When `IGNORE NULLS` is used with FIRST_VALUE, the function returns the first value in the frame that is not NULL (or NULL if all values are NULL). If not specified, the default is RESPECT NULLS.
9+
Returns the first value in the window frame.
1010

1111
See also:
1212

@@ -16,10 +16,12 @@ See also:
1616
## Syntax
1717

1818
```sql
19-
FIRST_VALUE(expression) [ { IGNORE | RESPECT } NULLS ] OVER ([PARTITION BY partition_expression] ORDER BY order_expression [window_frame])
19+
FIRST_VALUE (expression) [ { IGNORE | RESPECT } NULLS ] OVER ([PARTITION BY partition_expression] ORDER BY order_expression [window_frame])
2020
```
2121

22-
For the syntax of window frame, see [Window Frame Syntax](index.md#window-frame-syntax).
22+
- `[ { IGNORE | RESPECT } NULLS ]`: This option controls how NULL values are handled within the window function. By default, `RESPECT NULLS` is used, meaning NULL values are included in the calculation and affect the result. When set to `IGNORE NULLS`, NULL values are excluded from consideration, and the function operates only on non-NULL values.
23+
24+
- For the syntax of window frame, see [Window Frame Syntax](index.md#window-frame-syntax).
2325

2426
## Examples
2527

@@ -55,7 +57,7 @@ employee_id | first_name | last_name | salary | highest_salary_first_name
5557

5658
```
5759

58-
### Returning NON-NULLs with IGNORE NULLS
60+
This example excludes the NULL values from the window frame with the `IGNORE NULLS` option:
5961

6062
```sql
6163
CREATE or replace TABLE example AS SELECT * FROM (VALUES
@@ -88,5 +90,4 @@ FROM
8890
31639639
8991
412027639
9092
└───────────────────────────────────────────────────────┘
91-
92-
```
93+
```

docs/en/sql-reference/20-sql-functions/08-window-functions/last-value.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ title: LAST_VALUE
44

55
import FunctionDescription from '@site/src/components/FunctionDescription';
66

7-
<FunctionDescription description="Introduced: v1.2.568"/>
7+
<FunctionDescription description="Introduced or updated: v1.2.568"/>
88

9-
When `IGNORE NULLS` is used with LAST_VALUE, the function returns the last value in the frame that is not NULL (or NULL if all values are NULL). If not specified, the default is RESPECT NULLS.
9+
Returns the last value in the window frame.
1010

1111
See also:
1212

@@ -16,10 +16,12 @@ See also:
1616
## Syntax
1717

1818
```sql
19-
LAST_VALUE(expression) [ { IGNORE | RESPECT } NULLS ] OVER ([PARTITION BY partition_expression] ORDER BY order_expression [window_frame])
19+
LAST_VALUE (expression) [ { IGNORE | RESPECT } NULLS ] OVER ([PARTITION BY partition_expression] ORDER BY order_expression [window_frame])
2020
```
2121

22-
For the syntax of window frame, see [Window Frame Syntax](index.md#window-frame-syntax).
22+
- `[ { IGNORE | RESPECT } NULLS ]`: This option controls how NULL values are handled within the window function. By default, `RESPECT NULLS` is used, meaning NULL values are included in the calculation and affect the result. When set to `IGNORE NULLS`, NULL values are excluded from consideration, and the function operates only on non-NULL values.
23+
24+
- For the syntax of window frame, see [Window Frame Syntax](index.md#window-frame-syntax).
2325

2426
## Examples
2527

@@ -53,7 +55,7 @@ employee_id | first_name | last_name | salary | lowest_salary_first_name
5355
5 | Michael | Brown | 4500.00 | Michael
5456
```
5557

56-
### Returning NON-NULLs with IGNORE NULLS
58+
This example excludes the NULL values from the window frame with the `IGNORE NULLS` option:
5759

5860
```sql
5961
CREATE or replace TABLE example AS SELECT * FROM (VALUES
@@ -86,5 +88,4 @@ FROM
8688
31639614
8789
412027639
8890
└───────────────────────────────────────────────────────┘
89-
90-
```
91+
```

docs/en/sql-reference/20-sql-functions/08-window-functions/nth-value.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ title: NTH_VALUE
44

55
import FunctionDescription from '@site/src/components/FunctionDescription';
66

7-
<FunctionDescription description="Introduced: v1.2.568"/>
7+
<FunctionDescription description="Introduced or updated: v1.2.568"/>
88

9-
Returns expr evaluated at the nth row (among rows with a non-null value of expr if `IGNORE NULLS` is set) of the window frame (counting from 1); NULL if no such row.
9+
Returns the value at the `N`-th position within the window frame, where `N` is a specified integer that determines the exact position of the value.
1010

1111
See also:
1212

@@ -16,10 +16,12 @@ See also:
1616
## Syntax
1717

1818
```sql
19-
NTH_VALUE(expression, n) [ { IGNORE | RESPECT } NULLS ] OVER ([PARTITION BY partition_expression] ORDER BY order_expression [window_frame])
19+
NTH_VALUE (expression, n) [ { IGNORE | RESPECT } NULLS ] OVER ([PARTITION BY partition_expression] ORDER BY order_expression [window_frame])
2020
```
2121

22-
For the syntax of window frame, see [Window Frame Syntax](index.md#window-frame-syntax).
22+
- `[ { IGNORE | RESPECT } NULLS ]`: This option controls how NULL values are handled within the window function. By default, `RESPECT NULLS` is used, meaning NULL values are included in the calculation and affect the result. When set to `IGNORE NULLS`, NULL values are excluded from consideration, and the function operates only on non-NULL values.
23+
24+
- For the syntax of window frame, see [Window Frame Syntax](index.md#window-frame-syntax).
2325

2426
## Examples
2527

@@ -53,7 +55,7 @@ employee_id | first_name | last_name | salary | second_highest_salary_first_nam
5355
5 | Michael | Brown | 4500.00 | Jane
5456
```
5557

56-
### Returning NON-NULLs with IGNORE NULLS
58+
This example excludes the NULL values from the window frame with the `IGNORE NULLS` option:
5759

5860
```sql
5961
CREATE or replace TABLE example AS SELECT * FROM (VALUES
@@ -86,5 +88,4 @@ FROM
8688
31639NULL
8789
412027639
8890
└───────────────────────────────────────────────────────┘
89-
90-
```
91+
```

0 commit comments

Comments
 (0)