TopN and variants

 

I. Max / Min

1. Get the value

2. Get the row number of the corresponding record

3. Get the corresponding record

II. TopN

1. Get the value

2. Get the row number of the corresponding record

3. Get the corresponding record

III. Use in grouping

1. TopN calculations on subsets

2. TopN calculations in cumulative mode