Execute below script for create test table.
create table if not exists t1 (id1 int,id2 int);
Now, table is created, and it is empty table.
Execute below script,
select max(id1), max(id2) from t1
It will return below result(one row).
max(id1) max(id2)
----------- --------
<null> <null>
Execute below script,
select max(id1), max(id2) from t1 group by id1,id2
It will return below result(no result).
max(id1) max(id2)
----------- --------
Is there somebody explain the reason?
The documentation says:
In your first query, there is one group which does not have any records.
In your second query, there is no group.