Oracle Database SQL — Question 127
Which statement is true about using functions in WHERE and HAVING?
Answer options
- A. Using aggregate functions in the WHERE clause requires a subquery.
- B. Using aggregate functions in the HAVING clause requires a subquery.
- C. Using single-row functions in the WHERE clause requires a subquery.
- D. Using single-row functions in the HAVING clause requires a subquery.
Correct answer: A
Explanation
The correct answer is A because aggregate functions cannot be directly used in the WHERE clause without a subquery, as the WHERE clause operates on individual rows before aggregation. Options B, C, and D are incorrect as aggregate functions can be used in HAVING without a subquery, and single-row functions can be used in both WHERE and HAVING without requiring a subquery.