I'm struggling to write a query which returns a single row with summarized data and the last instance of an event.
Let's say I have a customer table and a sales transaction table. I need to write a query which returns the Total Sales by Customer along with the Date and Dollar amount of their Last Transaction.
In SQL Server server, i could use either cross apply or rank() functions. Unfortunately, this data comes from a webservice, so i cannot push this logic to the source system.