This clause is a syntactically more succinct “filter”—it ensures that windowed outputs meet the QUALIFY clauses’ predicate.
SELECT i, p, o
FROM qt
QUALIFY ROW_NUMBER() OVER (PARTITION BY p ORDER BY o) = 1
;
This ensures that the output over windows partitioned by p
have a row number that equals 1
.