Discussion
The HAVING clause acts like a WHERE clause, but it identifies groups that meet a criterion, rather than rows.
Answer: A
Correct answer: True
HAVING is the group-level counterpart of WHERE. It runs after GROUP BY has formed the groups and after the aggregates have been computed, so it can test them: HAVING COUNT(*) > 5 keeps only groups with more than five rows.
WHERE runs earlier, deciding which rows enter the groups, and cannot refer to an aggregate because at that point no group exists. Filtering on a plain column therefore belongs in WHERE, where it reduces the rows to be grouped, not in HAVING.
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development