In an effort to make my team write better SQL, I went over reports written by non-developers and code reviews, and gathered common mistakes and missed optimization opportunities in SQL.
Dividing integers, accidentally counting nullable columns, column position in
GROUP BY and
ORDER BY, and 9 other common gotchas. Don’t get got!