opteryx
opteryx copied to clipboard
aggregates without groups cannot reference aggregates in SELECT clause
trafficstars
Thank you for taking the time to report a problem with Opteryx.
To help us respond to your request, please provide the following details about the bug.
Describe the bug A clear and specific description of the bug. What error, incorrect, or unexpected behavior occurred?
A query that has an aggregate (such as COUNT), which is aliased, cannot reference the aggregate column by alias elsewhere in the select.
Expected behaviour A clear and concise description of what you expected to happen.
No error.
Sample Code/Statement If you can, please submit the SQL statement or Python code snippet, or a representative example using the sample datasets.
SELECT COUNT(*) AS c, c + c AS doubled FROM $planets
# Example Python code here
Additional context Add any other context about the problem here, for example what you have done to try to diagnose or workaround the problem, logs or error messages, the version of Opteryx and environment details (Python version, OS)