Full article here.
It is not always easy to spot “antipatterns” in your SQL, especially in more complex queries. In this article, Plamen demonstrates some of the most common SQL coding errors that he encounters, explains their root cause, and illustrates potential solutions
- NULLs and the NOT IN predicate
- Functions on indexed columns in predicates
- Incorrect subquery column
- Data type mismatch in predicates
- Predicate evaluation order
- Outer joins and placement of predicates
- Subqueries that return more than one value
- Use of SELECT *
- Scalar user-defined functions
- Overuse of cursors