Difference between where and having clauses


  1. Having
    1. HAVING specifies a search condition for a group or an aggregate function used in SELECT statement.
    2. HAVING clause select rows after grouping
    3. MAX,MIN,AVG,COUNT,SUM:(SUM and AVG functions only work on numeric data.)
  2. Where
    1. Where clause select rows before grouping


Related

find the nth highest salary in mysql without limit
How to find greater than average salary records in MySQL
how to find duplicate records in MySQL query
How to use second index forcefully in MySQL
How to get total number of rows in MySQL table with and without count