Skip to content
This repository was archived by the owner on Apr 16, 2022. It is now read-only.
This repository was archived by the owner on Apr 16, 2022. It is now read-only.

Grouping LedgerUnion: General error: 1111 Invalid use of group function #8

@romaninsh

Description

@romaninsh

Normally UnionModel can be grouped using a built-in method already. Even though the query seems fine, it produces the following error:

error: "SQLSTATE[HY000]: General error: 1111 Invalid use of group function" (further reported in #8)

It appears that generated SQL query is invalid containing:

sum(NULL) `due_net`, 

Normally sum() must have an argument. The aggregation is defined:

'due_net'=>'sum([])',

And this is defined in a UnionModel:

$this->addExpression('due_net', ['[total_net] * [pct]', 'type'=>'money']);

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions