QuestionQ17Verified/Reporting Aggregated Data Using the Group FunctionsCopy linkReport a problemAsk AstroTutorSave questionWhich statement is accurate about using functions in WHERE and HAVING clauses?AUsing aggregate functions in the WHERE clause requires a subquery.BUsing aggregate functions in the HAVING clause requires a subquery.CUsing single-row functions in the WHERE clause requires a subquery.DUsing single-row functions in the HAVING clause requires a subquery.Show AnswerAnswerExplanationWHERE filters rows before aggregate calculations are performed, so an aggregate function such as AVG, SUM, or COUNT cannot be used directly there. A subquery can calculate the aggregate result and make it available to the outer WHERE condition. Aggregate functions are designed for use in HAVING, while single-row functions can be used without requiring a subquery.Learn moreOracle Database SQL Language Reference — SELECTShow comments2Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion