What is the difference between WHERE and HAVING?

SQL Fundamentals Easy

SQL Fundamentals — Easy

What is the difference between WHERE and HAVING?

Key points

  • WHERE filters individual rows before any grouping occurs
  • HAVING filters groups of rows after they have been grouped
  • Understanding this distinction is crucial for writing efficient SQL queries

Ready to go further?

Related questions