Given an index OrderItems
OrderDateTm OrderId CustId OrderItem Qty
10/10 9:11am 123456 acme Shirt 2
10/10 9:11am 123456 acme Pants 1
10/10 9:11am 123456 acme Hat 3
10/10 9:10am 101234 jones iphone 1
10/10 9:09am 765333 acme paperclip 100
10/10 9:09am 765333 acme pen-blue 10
10/10 9:09am 765333 acme pen-red 20
10/10 9:07am 555890 willson coffee 4
I want to return all records for the most recent 50 Orders of a given CustomerId. And will need to page to the next 50 orders. An order could have 1-n items, so a result of the last 50 orders for a customer like "acme" would represent at least 50 records or perhaps several thousand records.
Sums or counts are not needed, just the full records, like shown above, so I haven't been able to figure out how to do this using Aggs. The answer is probably obvious(!) but all the examples I've found so far solve for something different. Many thanks in advance… : )
edit: ack!!! ...formatting fail.