Skip to content

Give better error: all non-aggregates must be covered by GROUP-BY clause #261

@tbm

Description

@tbm
beanquery> SELECT account, SUM(CONVERT(position, 'USD', date)), balance WHERE account ~ "Expenses:" AND '2025-08-31-bangkok-thailand' in links GROUP BY 1 ORDER BY 1
error: 
Traceback (most recent call last):
  File "/home/tbm/.local/lib/python3.11/site-packages/beanquery/shell.py", line 244, in cmdloop
...
    raise CompilationError(
beanquery.compiler.CompilationError: all non-aggregates must be covered by GROUP-BY clause in aggregate query: the following targets are missing: "balance"

woud be nice to get an error instead of a backtrace.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions