| ROW_NUMBER() | Returns the row number, remains ordered even if another sorting criterion is established where the ID is disordered. | ROW_NUMBER() OVER (ORDER BY column) | SELECT name, ROW_NUMBER() OVER (ORDER BY name) FROM employees |
| OVER (PARTITION BY campo ORDER BY campo2) | Partitions according to field and field2, ordering by field 2 and grouping result values according to this partition. | OVER (PARTITION BY column1 ORDER BY column2) | SELECT name, SUM(salary) OVER (PARTITION BY department ORDER BY salary) FROM employees |
| FIRST_VALUE(campo) | Brings the first value of a series of data. | FIRST_VALUE(column) OVER (ORDER BY column) | SELECT name, FIRST_VALUE(name) OVER (ORDER BY name) FROM employees |
| LAST_VALUE(campo) | Brings the last value of a series of data. | LAST_VALUE(column) OVER (ORDER BY column) | SELECT name, LAST_VALUE(name) OVER (ORDER BY name) FROM employees |
| NTH_VALUE(campo, row_num) | Brings the nth value of a series of data. | NTH_VALUE(column, n) OVER (ORDER BY column) | SELECT name, NTH_VALUE(name, 3) OVER (ORDER BY name) FROM employees |
| RANK() | Ranks values according to partition and order by if applicable. | RANK() OVER (ORDER BY column) | SELECT name, RANK() OVER (ORDER BY salary) FROM employees |
| DENSE_RANK() | Like rank, but if there are several tied values, instead of jumping (e.g.: 1,1,1,4,4,6) it maintains the order (e.g.:1,1,1,2,2,3). | DENSE_RANK() OVER (ORDER BY column) | SELECT name, DENSE_RANK() OVER (ORDER BY salary) FROM employees |
| PERCENT_RANK() | Ranks according to the percentage to which the value belongs, through the following formula: ( RANK() - 1 ) / ( total rows - 1). | PERCENT_RANK() OVER (ORDER BY column) | SELECT name, PERCENT_RANK() OVER (ORDER BY salary) FROM employees |