What happened?
PRQL compiler version:0.9.2
I found some related discussions in #2057. But some databases (such as Postgres, DuckDB, and Clickhouse) do not support a select clause to include a column that is not used in an aggregate function without a group by clause.
Error message from duckdb: Binder Error: column c0 must appear in the GROUP BY clause or be used in an aggregate function. Either add it to the GROUP BY list, or use "ANY_VALUE(c0)" if the exact value of "c0" is not important.
PRQL input
prql target:sql.duckdb
from tb1
sort {c0}
aggregate {new_col = min c1}
SQL output
WITH table_0 AS (
SELECT
MIN(c1) AS new_col,
c0
FROM
tb1
)
SELECT
new_col
FROM
table_0
Expected SQL output
WITH table_0 AS (
SELECT
MIN(c1) AS new_col
FROM
tb1
)
SELECT
new_col
FROM
table_0
MVCE confirmation
Anything else?
No response
What happened?
PRQL compiler version:0.9.2
I found some related discussions in #2057. But some databases (such as Postgres, DuckDB, and Clickhouse) do not support a
selectclause to include a column that is not used in an aggregate function without agroup byclause.Error message from duckdb: Binder Error: column c0 must appear in the GROUP BY clause or be used in an aggregate function. Either add it to the GROUP BY list, or use "ANY_VALUE(c0)" if the exact value of "c0" is not important.
PRQL input
SQL output
Expected SQL output
MVCE confirmation
Anything else?
No response