Greenplum built-in windows functions

Any aggregate function (used with the OVER clause) can also be used as a window function
  1. cume_dist()
  2. dense_rank()
  3. first_value(expr)
  4. lag(expr [,offset] [,default])
  5. last_value(expr)
  6. lead(expr [,offset] [,default])
  7. ntile(expr)
  8. percent_rank()
  9. rank()
  10. row_number()

sachi=# select x, row_number() over() from generate_series(1, 15, 2) as t(x);
 x  | row_number 
----+------------
  1 |          1
  3 |          2
  5 |          3
  7 |          4
  9 |          5
 11 |          6
 13 |          7
 15 |          8
(8 rows)


On-Line Analytic Processing: The purpose of OLAP is to quickly provide answers to multi-dimensional queries.
“Window” Functions: Allow access to multiple rows in a single table scan.

OLAP Grouping Extensions: Similar to GROUP BY but much more flexible. For example
  1. Standard GROUP BY Example
  2. ROLLUP
  3. GROUPING SETS
  4. CUBE 
  5. grouping(column [, ...]) function
  6. group_id() function
Comments