Computes a continuous percentile value using linear interpolation across the values in a group.
FLOAT64Diperbarui: 13 Jun 2026PERCENTILE_CONT(expression, percentile) OVER ([PARTITION BY partition_expression])Numeric column to compute the percentile from
Percentile value between 0 and 1
Divides data into groups
1 SELECT 2 department, 3 name, 4 salary, 5 PERCENTILE_CONT(salary, 0.5) OVER (PARTITION BY department) as median_salary 6 FROM `project.dataset.employees`;
Median salary per department using linear interpolation.
| department | name | salary | median_salary |
|---|---|---|---|
| Sales | David | 50000 | 75000.0 |
| Sales | Bob | 80000 | 75000.0 |
| Sales | Alice | 120000 | 75000.0 |
1 SELECT 2 category, 3 PERCENTILE_CONT(price, 0.25) OVER (PARTITION BY category) as p25, 4 PERCENTILE_CONT(price, 0.5) OVER (PARTITION BY category) as median, 5 PERCENTILE_CONT(price, 0.75) OVER (PARTITION BY category) as p75 6 FROM `project.dataset.products`;
Price quartiles per category.
Sudah paham PERCENTILE_CONT? Latih langsung di browser
Latihan interaktif, langsung di browser.