Documentation for the percent_rank window function
returns the relative rank (i.e. percentile) of rows within a window partition.SyntaxAlias: percentRank (case-sensitive)
percent_rank () OVER ([[PARTITION BY grouping_column] [ORDER BY sorting_column] | [window_name])FROM table_nameWINDOW window_name as ([PARTITION BY grouping_column] [ORDER BY sorting_column])
The function always reads the whole partition; a window frame, if specified, is ignored.For more detail on window function syntax see: Window Functions - Syntax.Example