I’m trying to create a query in pl/sql to get the following result:
Data:
Id | Date | Request
1 | 10/09/10 | 111
2 | 09/09/10 | 100
3 | 13/09/10 | 111
4 | 01/08/10 | 222
5 | 08/07/10 | 100
6 | 06/07/10 | 111
7 | 04/07/10 | 100
8 | 01/06/10 | 222
To get the folowing result:
Id | Date | Request
8 | 01/06/10 | 222
4 | 01/08/10 | 222
7 | 04/07/10 | 100
2 | 09/09/10 | 100
5 | 08/07/10 | 100
6 | 06/07/10 | 111
1 | 10/09/10 | 111
3 | 13/09/10 | 111
Ps: in this exaxmple the format date is (dd/mm/yy)
As you can see on the example, firstly order by Date, but when catch the first row, list all the rows with the same Request, when finish the rows with the same Request, keep ordering by Date…
Can anyone help me with this query? I have tried a few ways, but with no expected result.
You can use analytics: