Want to find the value at the nth percentile with #SQL? Use PERCENTILE_CONT ( n ) WITHIN GROUP( ORDER BY close_price ) n is between 0 and 1, so 0.5 => median 0.75 => 75th percentile 0.99 => 99th percentile @vladmihalcea.bsky.social demos
How to calculate percentiles with SQL PERCENTILE_CONT - Vlad Mihalcea
Learn how to calculate percentiles with the SQL PERCENTILE_CONT function on PostgreSQL, MySQL, Oracle, or SQL Server.
buff.ly