ambitious-airport-565
12/02/2025, 9:59 PMwithin group ORDER BY clauses for aggregate functions must be the same.
⢠DB: redshift
⢠failing query section:
__capValue AS (
SELECT
PERCENTILE_CONT(0.999) WITHIN GROUP (
ORDER BY
m0_value
) AS m0_value_cap,
PERCENTILE_CONT(0.999) WITHIN GROUP (
ORDER BY
m0_denominator
) AS m0_denominator_cap
FROM
__userMetricAgg
)
The error arises from the capValue CTE calculating 2 percentiles with different order bys. If the pattern leveraged separate CTEs for each percentile, it would run
Is this a known issues that is being worked on?strong-mouse-55694
12/02/2025, 11:24 PMfierce-london-55569
12/03/2025, 9:56 AMstrong-mouse-55694
12/03/2025, 6:53 PMfierce-london-55569
12/04/2025, 9:52 AMrapid-sundown-31376
12/08/2025, 9:47 PMstrong-mouse-55694
12/08/2025, 10:31 PMambitious-airport-565
03/02/2026, 5:58 PMstrong-mouse-55694
03/02/2026, 6:11 PMstrong-mouse-55694
03/03/2026, 4:41 PM