I have a list of Users in the system with User ID's, Application ID they accessed & sequence number for each step.
Now I want to select a list of the latest applications accessed by user (With Sequence numbers).
Complete List
----------------------------------------------------------------------
| User# | Application# | Sequence# |
| 1 | 4 | 1 |
| 1 | 4 | 2 |
| 1 | 4 | 3 |
| 1 | 5 | 1 |
| 1 | 5 | 2 |
| 1 | 5 | 3 |
| 1 | 9 | 1 |
| 1 | 9 | 2 |
| 1 | 9 | 3 |
| 2 | 7 | 1 |
| 2 | 7 | 2 |
| 2 | 7 | 3 |
| 2 | 3 | 1 |
| 2 | 3 | 2 |
| 2 | 3 | 3 |
----------------------------------------------------------------------
Filtered List needed (Assume that each Application has a time-stamp used for access (We can compare time-stamps and let the latest application accessed for each user):
----------------------------------------------------------------------
| User# | Application# | Sequence# |
| 1 | 4 | 1 |
| 1 | 4 | 2 |
| 1 | 4 | 3 |
| 2 | 3 | 1 |
| 2 | 3 | 2 |
| 2 | 3 | 3 |
| | | |
----------------------------------------------------------------------
Assume that the fields on the Table are "UserID", "ApplicationID", "SeqID".
The constraint is that I want the second list records in the same List order as the first. If user "1" comes before in the First list then that users records (All grouped records for the application selected) will come before in second list and so on.
Any ideas on how to format the Query?
Please let me know if I am not clear.