Fixed #15624 -- Made sure aggregations are present in SELECT