Take the following table:
Supplier Invoice No. Invoice Date Invoice Amount
A 1 01.01.03 300,-
B 2 02.02.03 200,-
C 3 03.03.03 100,-
Etc. etc. let's say it contains 500 rows.
With the ranking function it's easy to fetch the top 20 Invoice Amounts and sort them by Supplier.
However, I want to first sort these by Invoice Date and display only the 20 most recent ones (Invoice Date is insignificant). In other words I want to rank the table by Invoice Date.
How do I do this?
Supplier Invoice No. Invoice Date Invoice Amount
A 1 01.01.03 300,-
B 2 02.02.03 200,-
C 3 03.03.03 100,-
Etc. etc. let's say it contains 500 rows.
With the ranking function it's easy to fetch the top 20 Invoice Amounts and sort them by Supplier.
However, I want to first sort these by Invoice Date and display only the 20 most recent ones (Invoice Date is insignificant). In other words I want to rank the table by Invoice Date.
How do I do this?