Fix column name escaping in aggregate queries