1 Respuesta
- Más nuevo
- Más votos
- Más comentarios
1
I was able to achieve the results you expected with a different SQL. Kindly see if this will help your use case.
create table tst_ordr
( ID NUMERIC,
tmstmp TIMESTAMP
);
INSERT INTO tst_ordr values
(1001,'2023-10-01 08:00:00'),
(1002,'2023-10-01 08:00:00'),
(1002,'2023-10-01 08:30:00'),
(1002,'2023-10-01 09:00:00'),
(1003,'2023-10-01 08:00:00'),
(1003,'2023-10-01 08:15:00'),
(1003,'2023-10-01 08:30:00'),
(1003,'2023-10-01 08:45:00'),
(1004,'2023-10-01 08:30:00')
;
select *,
row_number()
over (partition by id
order by ID, tmstmp)
as "Order"
from tst_ordr
order by 1,3;
respondido hace 7 meses
Contenido relevante
- OFICIAL DE AWSActualizada hace 2 años
- OFICIAL DE AWSActualizada hace 9 meses
- OFICIAL DE AWSActualizada hace 2 años
- OFICIAL DE AWSActualizada hace 2 años
Thank you!! This is exactly what I was looking for!