News for hackers. Stuff that matters.
Re:Our SQL interview questions by jacques_chester on Tuesday May 28, 2013 @07:50PM (#5783644)
When I learnt SQL, the part that took me the longest to square away was the distinction between WHERE and HAVING. It was thoroughly confusing at the time.

Once you grasp that conceptually, SQL generally executes left-to-right, it's easier.

Re:Our SQL interview questions by siddboots on Friday May 31, 2013 @06:28AM (#5797733)
I avoid `having` wherever possible these days. There are data analysts in my team that I know would have to think twice about it if they encountered it in my code, and to be honest, it's a bit of an wart in the SQL grammar anyway.

In (almost) all cases, a subquery with an extra `where` clause will have equal performance to a `having` clause in the main query.

See the final example in: http://en.wikipedia.org/wiki/Having_(SQL)