-
-
Notifications
You must be signed in to change notification settings - Fork 265
Open
Description
Run this query:
select
a,
percent_rank() over (order by a desc) "p1"
from (
select 1 a from rdb$database union all
select 2 a from rdb$database union all
select 3 a from rdb$database union all
select 4 a from rdb$database
) t
order by a ascThe correct result as produced by Firebird 4 was:
1 1
2 0.66666666666667
3 0.33333333333333
4 0
Firebird 5.0.3 now produces:
1 0.1111111111111111
2 0.16666666666666666
3 0.3333333333333333
4 0.0
I'm using Firebird from here: https://hub.docker.com/r/firebirdsql/firebird.
A workaround, I can calculate percent_rank() over (order by a desc) myself using rank() over (order by a desc) - 1.0) / (count(*) over () - 1.0)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels