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

clickhouse: GROUP BY ... WITH TOTALS fails #1609

Closed
pkit opened this issue May 12, 2023 · 2 comments
Closed

clickhouse: GROUP BY ... WITH TOTALS fails #1609

pkit opened this issue May 12, 2023 · 2 comments

Comments

@pkit
Copy link
Contributor

pkit commented May 12, 2023

SELECT
    number,
    count() / 0.1
FROM
(
    SELECT number
    FROM system.numbers
    LIMIT 10
)
GROUP BY number
    WITH TOTALS
HAVING count() > 0.1
ORDER BY number ASC

Invalid expression / Unexpected token. Line 11, Col: 15.
  nt() / 0.1
FROM
(
    SELECT number
    FROM system.numbers
    LIMIT 10
)
GROUP BY number
    WITH 🔻TOTALS🔻
HAVING count() > 0.1
ORDER BY number ASC

See https://clickhouse.com/docs/en/sql-reference/statements/select/group-by#with-totals-modifier

@tobymao
Copy link
Owner

tobymao commented May 12, 2023

please link to the relevant documentation

@pkit
Copy link
Contributor Author

pkit commented May 12, 2023

Sorry, updated.

adrianisk pushed a commit to adrianisk/sqlglot that referenced this issue Jun 21, 2023
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