QuestionQ201Verified/Manipulating DataCopy linkReport a problemAsk AstroTutorSave questionExamine the definition of the EMPLOYEES table: Which query is valid?ASELECT dept_id, join_date, SUM(salary) FROM employees GROUP BY dept_id;BSELECT dept_id, join_date, SUM(salary) FROM employees GROUP BY dept_id, join_date;CSELECT dept_id, MAX(AVG(salary)) FROM employees GROUP BY dept_id;DSELECT dept_id, AVG(MAX(salary)) FROM employees GROUP BY dept_id;Show AnswerAnswerExplanationWhen a query uses GROUP BY, each selected item must be either a grouping expression, an aggregate expression, or a constant. Grouping by both DEPT_ID and JOIN_DATE permits those columns to appear with SUM(SALARY). Oracle does not allow nested group functions in the same query block. Oracle Database SQL Language Reference: SELECTLearn moreOracle Database SQL Language Reference: SELECTShow comments0Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion