'Numbering data loads per day by hour
In Amazon Redshift I have table with informations about data loads in this schema:
| DATA_LOAD DAY | DATA_LOAD HOUR |
|---|---|
| 2022-03-16 | 15:11:23 |
| 2022-03-16 | 09:12:45 |
| 2022-03-15 | 11:12:43 |
| 2022-03-15 | 08:21:54 |
| 2022-03-14 | 21:42:21 |
| 2022-03-14 | 10:22:43 |
| 2022-03-14 | 07:21:14 |
etc, its ordered by DATA_LOAD HOUR desc
I want to create a view like this, kind of numbering loads per day by hour:
| DATA_LOAD DAY | DATA_LOAD HOUR | NUMER OF LOAD |
|---|---|---|
| 2022-03-16 | 15:11:23 | 2 |
| 2022-03-16 | 09:12:45 | 1 |
| 2022-03-15 | 11:12:43 | 2 |
| 2022-03-15 | 08:21:54 | 1 |
| 2022-03-14 | 21:42:21 | 3 |
| 2022-03-14 | 10:22:43 | 2 |
| 2022-03-14 | 07:21:14 | 1 |
I really don't have idea how to do it, any ideas?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
