Oracle Message QSM-01061 - illegal query expression

ERRORillegal query expression
CAUSEAn illegal query was specified. Specifically one of the following criteria was not satisfied: (a) All (non-constant, non-aggregate) SELECT expressions in the query should be made up of group expressions. (b) All column references in the HAVING clause should come from the GROUP BY expressions. (c) If there is an ORDER BY clause, then all column references should come from the GROUP BY or SELECT clause, depending on whether the query selects DISTINCT.
ACTIONCorrect error in the syntax and rerun the query.