Back (Current repo: scraps)

random scraps and notes that are useful to me
To clone this repository:
git clone https://git.viktor1993.net/scraps.git
Log | Download | Files | Refs

where_vs_having.txt (406B)


Q: What is the difference between WHERE and HAVING?

A: The main difference is that WHERE filters individual rows before any grouping or aggregation occurs, while HAVING filters groups after the GROUP BY clause has been applied and aggregated. An important practicality of this difference is that HAVING only makes sense with SELECT queries, whereas WHERE can be used for UDATE and DELETE queries as well.