X Tutup
The Wayback Machine - https://web.archive.org/web/20201011185237/https://github.com/JSQLParser/JSqlParser/issues/979
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

Support for GROUPING in HAVING and ORDER BY #979

Open
SerialVelocity opened this issue May 1, 2020 · 0 comments
Open

Support for GROUPING in HAVING and ORDER BY #979

SerialVelocity opened this issue May 1, 2020 · 0 comments

Comments

@SerialVelocity
Copy link

@SerialVelocity SerialVelocity commented May 1, 2020

Describe the bug
A clear and concise description of what the bug is.

These queries should parse successfully in JSqlParser (these queries work for both Oracle and Postgres. Not sure what other languages):

SELECT * FROM (SELECT 1 AS id) t GROUP BY CUBE(id) ORDER BY GROUPING(id);
SELECT * FROM (SELECT 1 AS id) t GROUP BY CUBE(id) HAVING GROUPING(id) = 1;
SELECT * FROM (SELECT 1 AS id) t GROUP BY CUBE(id) HAVING GROUPING(id) = 1 ORDER BY GROUPING(id);

To Reproduce
Steps to reproduce the behavior:

  1. Example SQL above
  2. Parsing this SQL using JSqlParser with this statements
  3. Exception:
Caused by: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "GROUPING" "GROUPING"
    at line 1, column 61.

Was expecting one of:

    "!"
    "("
    "NOT"

Expected behavior
The query to be parsed successfully.

System

  • Database you are using: Postgresql 9.6.x
  • Java Version: 11
  • JSqlParser version: 3.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.
X Tutup