SELECT id, n, ROUND(100.0 * n / SUM(n) OVER (), 2) AS "pc",
           ROUND(100.0 * ((1.0 - exp(-id * p.threshold / 10.0)) -
           (1.0 - exp(-(id-1) * p.threshold / 10.0))) /
           (1.0 - exp(- p.threshold)), 2) AS "%"
FROM Compteur,
 -- parameters!
 (SELECT 5.7 AS threshold) AS p
GROUP BY id, p.threshold
ORDER BY "%" DESC;
