I'm struggling to build a HQL query against a customer invoice table where I want to return a list of the most recent invoices for each customer but across all customers, like...
Here's a sample full table...
Code:
[customer id] [invoice date] [invoice number] [invoice value]
1 2009/10/1 3511 44,567.56
1 2009/10/15 4512 17,333.56
2 2009/10/4 2222 23,954.56
2 2009/10/7 5555 75,567.56
3 2009/10/3 6655 81,000.56
3 2009/10/18 3888 71,123.56
.. and my HQL query should return just the latest invoices for each customer, like...
Code:
[customer id] [invoice date] [invoice number] [invoice value]
1 2009/10/15 4512 17,333.56
2 2009/10/7 5555 75,567.56
3 2009/10/18 3888 71,123.56
Any ideas?