sql-psi
sql-psi copied to clipboard
Percentile queries in Postgres. (WITHIN GROUP (ORDER BY myTable.myColumn))
Dialect
PostgreSQL
Failing SQL
SELECT percentile_disc(.5) WITHIN GROUP (ORDER BY myTable.myColumn) as P5
FROM myTable
Description
BY expected, got '('
Versions: sqldelight = "1.5.3" sqlpsi = "0.3.15"
It appears that SqlDelight is expecting the keyword BY
to always come after the keyword GROUP
. Link to Postgres docs - https://www.postgresql.org/docs/9.4/functions-aggregate.html