I'm using DB2
database. I have a table that contains the following columns:
Group | Name | Date | Value
I want to select the 10 last values (ordered by date) for each Group. How can I do that in DB2 ? Many thanks.
UPDATE :
Here is what I did so far :
select Group, DATE
from MyTable
ORDER BY Group, DATE
FETCH FIRST 10 ROWS ONLY
This sql command return the first 10 rows of the results and I want to get 10 last results for each Group.