Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subquery alias error #43

Open
jpmonettas opened this issue Jun 29, 2020 · 0 comments
Open

Subquery alias error #43

jpmonettas opened this issue Jun 29, 2020 · 0 comments
Assignees

Comments

@jpmonettas
Copy link

Hi, I'm running into the subquery in FROM must have an alias error when generating a sub query and attempting to run it in postgres.

(sql/format {:select [:type]
             :from [[{:select [[:address :field-alias]]
                      :from [:Candidate]} :sub-q-alias]]}
            :parameterizer :postgresql)

;;=> ["SELECT type FROM (SELECT address AS field_alias FROM Candidate) sub_q_alias"]

Postgres instead of :

.. FROM (SELECT ...) sub_q_alias

seems to need :

.. FROM (SELECT ...) AS sub_q_alias

I reported the same issue in the original honeysql repo seancorfield/honeysql#263, but I imagine the solution here can be different and maybe easier than there.

Thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants