While Dmitry's CUME_DIST()
solution is probably better suited for the actual query, here's the ROWNUM
solution in jOOQ, for the record:
// Qualified
DSL.rownum().div(DSL.max(DSL.rownum()).over());
// With static imports of DSL.*
rownum().div(max(rownum()).over());
See also: DSL.rownum()