When `count(column)` is used on selection `group` and `having` conditions are ignored
MartinMystikJonas opened this issue · 2 comments
MartinMystikJonas commented
Version: all
Bug Description
When count(column)
is used on selection group
and having
conditions are ignored
Steps To Reproduce
$selection->group('column1')->having('SUM(column2) > 0')->count('column1')
Expected Behavior
Return only rows where having conditions is met instead or all rows.
Possible Solution
Also copy group and having parameters in importConditions
of SqlBuilder
database/src/Database/Table/SqlBuilder.php
Line 239 in f0e3796
Or is there reason why it is not copied?
MartinMystikJonas commented
I can prepare PR if proposed fix is ok.
dg commented
I can prepare PR if proposed fix is ok.
That would be great.