QuestionQ46Verified/Manipulating DataCopy linkReport a problemAsk AstroTutorSave questionReview the definition of the PRODUCTS table: Which query is valid?ASELECT prod_id, release_date, SUM(cost) FROM products GROUP BY prod_id;BSELECT prod_id, release_date, SUM(cost) FROM products GROUP BY prod_id, release_date;CSELECT prod_id, AVG(MAX(cost)) FROM products GROUP BY prod_id;DSELECT prod_id, MAX(AVG(cost)) FROM products GROUP BY prod_id;Show AnswerAnswerExplanationIn an Oracle query with GROUP BY, each selected expression must be an aggregate, a grouping expression, a constant, or an expression involving one. Grouping by both PROD_ID and RELEASE_DATE permits SUM(COST) for each such group. Aggregate functions cannot be nested within one another in the same query block.Learn moreOracle Database SQL Language Reference — Aggregate FunctionsShow comments0Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion