Difference between having and where clause?

771    Asked by SaitoIto in Business Analyst , Asked on May 12, 2019
Answered by Saito Ito

A ‘where’ clause is utilized to get information from the database that indicates specific criteria (indicated after the where clause) while a ‘having’ clause is utilized together with ‘GROUPBY’ to fetch information that meets specific criteria specified by the aggregate function.

Writing a query using "where" clause,

Sample Query,

Select student_name from School where marks >= 75;

Writing a query using "having" clause,

Select student_name from School GROUPBY student having count (subjects)>12;



Your Answer

Interviews

Parent Categories