We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
1. WHERE is used to filter rows before grouping and HAVING is used to exclude records after grouping
2. HAVING can only be used if grouping has been performed using GROUP BY clause in the SQL query.
3. WHERE clause cannot contain aggregate function like COUNT(), SUM(), MAX(), MIN(), etc but HAVING clause may contain aggregate functions.
4. WHERE is used to impose filtering criterion on a SELECT, UPDATE, DELETE statement as well as single row function and used before group by clause but HAVING is always used after group by clause.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Employee Salaries
You are viewing a single comment's thread. Return to all comments →
DIFFERENCE BETWEEN HAVING AND WHERE