OPSMN-1542: AQ: Fixed query generator to use select field expression SQL instead of alias, as Oracle doesn't like using alias in group by clause