The frame starts at NULL  and stops at NULL , thus includes only rows with value NULL . 

• ORDER BY X ASC RANGE BETWEEN 10 PRECEDING AND 1 PRECEDING 

The frame starts at NULL  and stops at NULL , thus includes only rows with value NULL . 

• ORDER BY X ASC RANGE BETWEEN UNBOUNDED PRECEDING AND 10 FOLLOWING 

The frame starts at the beginning of the partition and stops at rows with value NULL . Because an ASC sort puts NULL  values first, the frame is only the NULL  values. 

## 12.21.4 Named Windows 

Windows can be defined and given names by which to refer to them in OVER  clauses. To do this, use a WINDOW  clause. If present in a query, the WINDOW  clause falls between the positions of the HAVING  and ORDER BY  clauses, and has this syntax: 

WINDOW window_name  AS ( window_spec ) [, window_name  AS ( window_spec )] ... 

For each window definition, window_name  is the window name, and window_spec  is the same type of window specification as given between the parentheses of an OVER  clause, as described in Section 12.21.2, “Window Function Concepts and Syntax” : 

window_spec : [ window_name ] [ partition_clause ] [ order_clause ] [ frame_clause ] 

A WINDOW  clause is useful for queries in which multiple OVER  clauses would otherwise define the same window. Instead, you can define the window once, give it a name, and refer to the name in the OVER clauses. Consider this query, which defines the same window multiple times: 

SELECT val, ROW_NUMBER() OVER (ORDER BY val) AS ’row_number’, RANK() OVER (ORDER BY val) AS ’rank’, DENSE_RANK() OVER (ORDER BY val) AS ’dense_rank’ FROM numbers; 

The query can be written more simply by using WINDOW  to define the window once and referring to the window by name in the OVER  clauses: 

SELECT val, ROW_NUMBER() OVER w AS ’row_number’, RANK() OVER w AS ’rank’, DENSE_RANK() OVER w AS ’dense_rank’ FROM numbers WINDOW w AS (ORDER BY val); 

A named window also makes it easier to experiment with the window definition to see the effect on query results. You need only modify the window definition in the WINDOW  clause, rather than multiple OVER clause definitions. 

If an OVER  clause uses OVER ( window_name  ...)  rather than OVER window_name , the named window can be modified by the addition of other clauses. For example, this query defines a window that includes partitioning, and uses ORDER BY  in the OVER  clauses to modify the window in different ways: 

SELECT DISTINCT year, country, 

