Closed
Description
Here is the failing sql:
SELECT
DISTINCT ON (column1) column_alias,
column2
FROM
table_name
ORDER BY
column1,
column2;
Note that this parses without errors because it parses the ON (column1)
as a function.
When serializing back to string from ast, it produces:
SELECT DISTINCT ON(column1) AS column_alias, column2 FROM table_name ORDER BY column1, column2
The AS
should not be there (it is an error in Postgres)
Metadata
Metadata
Assignees
Labels
No labels