Yet another very common error is when someone puts a wrong condition in a WHERE clause and that essentially renders an outer join into an inner join. A great advice on coding predicates in outer joins comes from a DB2 expert Terry Purcell.
"Meet the experts: Terry Purcell on coding predicates in outer joins: A comparison of simple outer join constructs"
If you would like to receive an email when updates are made to this post, please register here
Subscribe to this post's comments using
About Alexander Kuznetsov
Alex Kuznetsov has been working with object oriented languages, mostly C# and C++, as well as with databases for more than a decade. He has worked with Sybase, SQL Server, Oracle and DB2. He regularly blogs on sqlblog.com, mostly about database unit testing, defensive programming, and query optimization.
Alex has written a book entitled "Defensive Database Programming with Transact-SQL" and several articles on simple-talk.com and devx.com. Currently he works as an agile developer.