Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

select item check issue for aggregate queries #899

Closed
rupal-bq opened this issue Dec 8, 2020 · 0 comments
Closed

select item check issue for aggregate queries #899

rupal-bq opened this issue Dec 8, 2020 · 0 comments
Assignees
Labels
bug Something isn't working SQL

Comments

@rupal-bq
Copy link
Contributor

rupal-bq commented Dec 8, 2020

For queries with HAVING clause only (without GROUP BY), the select list fails to handle functions applied to literal (it only allows literal in this case which is wrong)

Query:

SELECT (TO_DAYS(DATE('2050-01-01')) - 693961)
FROM `calcs`
HAVING (COUNT(1) > 0)

Error message:

"Explicit GROUP BY clause is required because expression [-(TO_DAYS(DATE(2050-01-01)), 693961)] contains non- aggregated column"
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working SQL
Projects
None yet
Development

No branches or pull requests

2 participants