Restricting Groups |
||||
|
In the same way that you use the WHERE clause to restrict rows that are retrieved, you can use the HAVING clause to restrict groups that are retrieved. HAVING clause has to be placed immediately after the GROUP BY clause in the syntax. You specify the HAVING keyword followed by a condition that refers to a group of rows. You cannot use a HAVING clause in a statement without a GROUP BY clause.
|
||||
|
Write SQL query to to display the department ID and maximum salary for departments that have a maximum salary greater than $10,000. Use the HAVING clause to exclude any group results that do not meet the criterion of having a maximum salary of $10,000.
|
||||