My fiddle is here.
Work around : My table structure is
create table test (grIds int(1), amount int(1)); insert into test values (1,10), (1,20), (1,15), (2,0), (3,8), (3,25), (3,16), (4,0), (4,21);
I have two select clause
select grIds, max(amount) from test group by grIds having max(amount); select grIds, max(amount) from test group by grIds;
My question is why select with having keeps omitting row having grIds = 2 ?