Relative Content

Tag Archive for pythonsqloraclerank

How can I create a column, a kind of rank, that changes based on several columns in oracle sql, as in the example?

This is my table ordered by code and date_time
| date | code |date_time |user_id | operation |
| ——– | ——– | —————— | —— | — |
| 20240301 | 5600 | 01/03/2024 4:14:16 | 1 | OP1 |
|20240301|5600| 01/03/2024 6:13:11 |2|OP2|
|20240301|5600| 01/03/2024 8:35:37 |3|OP1|
|20240301|5600| 01/03/2024 8:53:20 |4|OP1|
|20240301|5600| 01/03/2024 9:28:40 |5|OP1|
|20240301|5600| 01/03/2024 9:33:18 |6|OP3|
|20240301|5600| 01/03/2024 9:33:28 |6|OP1|
|20240301|5600| 01/03/2024 10:16:09 |7|OP4|
|20240301|5600| 01/03/2024 10:16:12 |7|OP5|
|20240301|5600| 01/03/2024 10:16:43 |7|OP1|
|20240301|5600| 01/03/2024 10:18:06 |8|OP2|
|20240301|5600| 01/03/2024 10:25:25 |8|OP1|
|20240301|5600| 01/03/2024 10:38:41 |8|OP1|
|20240301|5600| 01/03/2024 10:47:07 |9|OP1|
|20240301|5600| 01/03/2024 10:47:58 |9|OP1|
|20240301|5600| 01/03/2024 11:08:32 |10|OP1|
|20240301|5600| 01/03/2024 11:35:37 |7|OP1|
|20240301|5600| 01/03/2024 11:36:37 |7|OP1|