QuestionQ116

VerifiedReporting Aggregated Data Using the Group Functions

Examine this description of the EMP table:

Question Image

You run the following query:

Question Image

What is the result?

Explanation

DEPTNO is selected alongside SUM(SAL), so it must be included in the GROUP BY clause as a grouping expression. GROUP BY 1 is a numeric literal rather than a valid positional reference under Oracle’s normal behavior; therefore, DEPTNO is not properly grouped and the statement raises a grouping error. Oracle documents positional grouping as an optional feature that is disabled by default.

Learn more

Community Discussion

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