QuestionQ78

VerifiedReporting Aggregated Data Using the Group Functions

Review the description of the EMPLOYEES table:

Question Image

You enter this statement, which fails:

Question Image

Which clause produces the error?

Explanation

Oracle permits a select-list column alias in an ORDER BY clause, but not in other clauses of the same query. department_id is an alias for dept_no, so GROUP BY department_id is invalid; the grouping must use dept_no instead.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!