KnowledgeBoat Logo

Computer Science

Aggregate functions can be used in the select list or the …………… clause of a select statement. They cannot be used in a …………… clause.

  1. Where, having
  2. Having, where
  3. Group by, having
  4. Group by, where

SQL Joins & Grouping

1 Like

Answer

Having, where

Reason — Aggregate functions can be used in the select list or the HAVING clause of a select statement. But they cannot be used in a WHERE clause. The reason for this is that the WHERE clause filters rows before any grouping or aggregation occurs, while HAVING clause applies conditions to groups after the data has been grouped using the GROUP BY clause.

Answered By

3 Likes


Related Questions