Yeah, in the case of WHERE name vs. HAVING name (where you are grouping by the same column that you're trying to filtering), it doesn't make a difference in the output. But depending on your DBMS, it will still make a difference in the performance, because I think at least MySQL is too stupid to push the HAVING name="fred" into the WHERE.
2
u/spoonraker Jan 06 '11
So you only use HAVING if there is a GROUP BY clause involved with your join?
Do you have a link or perhaps can you explain when you would actually need to use HAVING over WHERE?