HAVING vs WHERE in SQL
Go to solution
Solved by Limecat86,
1 hour ago, mrchow19910319 said:--SNIP--
so the difference between HAVING and WHERE is that WHERE can only apply to one element inside the database? and HAVING coming after GROUP BY while WHERE is always before GROUP BY?
am I understanding this correctly?
Yes that's correct. HAVING operates on aggregate functions (ex. COUNT) on grouped results. WHERE operates on each individual row.
Found some very good explanations on stackoverflow: https://stackoverflow.com/questions/9253244/sql-having-vs-where
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now