So what's the underlying reason that these databases barf on the queries? Is it because they expect the column rename (the select clause alias) to be used in the group-by? Because we use a param? Some other reason?