I have three columns
PID, AppNo and ProcessedDate
I need a query to update the AppNo in the format below
PID AppNo ProcessedDate
11 1 09/30/2019 18:21
3 1 09/25/2019 08:37
3 2 09/25/2019 08:37
11 1 09/25/2019 08:39
11 2 09/25/2019 08:40
7 1 09/26/2019 14:19
7 2 09/26/2019 14:20
7 3 09/26/2019 14:22
2 1 09/26/2019 14:23
11 1 09/26/2019 14:23
11 2 09/26/2019 14:24
11 3 09/26/2019 14:24
3 1 09/26/2019 14:24
For now the AppNo column is null.
This is the sql that is not working
SELECT AppNo, ProcessedDate,pid
,Row_Number() OVER(PARTITION BY pid, ProcessedDate ORDER BY ProcessedDate) AS rn
select * FROM table
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…