In order to find the most recent piece of data for a particular customer I need to query my table in 3 iterations.
I have a TABLE with data in it pertaining to all customers.
QUERY 1 orders all the records in TABLE by date.
QUERY 2 plucks all records related to specified customer from QUERY 1.
QUERY 3 selects the TOP 1 from QUERY 2.
My main concern is that this all happens automatically. Can I shorten this process at all?
I have a TABLE with data in it pertaining to all customers.
QUERY 1 orders all the records in TABLE by date.
QUERY 2 plucks all records related to specified customer from QUERY 1.
QUERY 3 selects the TOP 1 from QUERY 2.
My main concern is that this all happens automatically. Can I shorten this process at all?