whats the difference using where and having clause in mysql select? i can understand this. Can anybody help?
Let me give an example. you want to find customers telephone numbers who bought more than 2 products and their name is john. select phone, count(*) from sales where name='John' group by name having count(*)>2 having works like after your query executes. First you filter your table with the customers John. Than you group customername to find how many sales you made. And with using "having" you filtering the result set.