1 réponse
- Le plus récent
- Le plus de votes
- La plupart des commentaires
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;
répondu il y a 7 mois
Contenus pertinents
- demandé il y a un an
- demandé il y a un an
- demandé il y a 7 mois
- demandé il y a 2 mois
- AWS OFFICIELA mis à jour il y a 2 ans
- AWS OFFICIELA mis à jour il y a 2 ans
- AWS OFFICIELA mis à jour il y a 2 ans
Thank you!! This is exactly what I was looking for!