If a term of an ORDER BY or GROUP BY contains an aggregate function or column,