beanquery icon indicating copy to clipboard operation
beanquery copied to clipboard

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

Open tbm opened this issue 1 month ago • 0 comments

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.

tbm avatar Oct 22 '25 02:10 tbm