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

Allow nested parenthesized joined table #7576

Closed
mrotteveel opened this issue May 8, 2023 · 2 comments
Closed

Allow nested parenthesized joined table #7576

mrotteveel opened this issue May 8, 2023 · 2 comments

Comments

@mrotteveel
Copy link
Member

The current syntax allows only a single level of parentheses around joined tables, but the SQL:2016 syntax is:

<table primary> ::=
     [...]
  | <parenthesized joined table>

<parenthesized joined table> ::=
    <left paren> <parenthesized joined table> <right paren>
  | <left paren> <joined table> <right paren>

[...]

A simple syntax change allows this (I'll push a pull request shortly).

@asfernandes
Copy link
Member

Please give a example of a query that was not working.

@mrotteveel
Copy link
Member Author

The SQL standard syntax allows arbitrary depth of nesting in parentheses.

An example of a query that doesn't work without this syntax change:

select c.customer, ctr.currency
from ((
  customer c inner join country ctr 
    on c.country = ctr.country 
))

Obviously, the error can be solved by removing a level of parentheses, but I have seen tools generate similar queries, expecting arbitrary nesting to work.

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

No branches or pull requests

3 participants