Oracle Error QSM-01061: illegal query expression

Oracle Error Message

QSM-01061: illegal query expression

Reason for the Error

An 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.

Solution

Correct error in the syntax and rerun the query.