QuestionQ119

VerifiedReporting Aggregated Data Using the Group Functions

Examine the definition of the orders table:

Question Image

You need to determine the total value of all orders for each year and run this command:

Question Image

Which statement is true about the result?

Explanation

Oracle requires every nonaggregate expression in a grouped query's select list to be identical to an expression in the GROUP BY clause. TO_CHAR(order_date, 'rr') and TO_CHAR(order_date, 'yyyy') use different format models, so they are different expressions and the statement raises ORA-00979 rather than returning results.

Learn more

Community Discussion

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