Here’s an excerpt from an email someone sent me in response to my post previous post Why SQL failed.
Your SQL blog article got my attention since I recently had to fix some SQL code that someone else wrote that has been in production for the last 4 years, running on a dataset containing about 3 million records. It performed some compound operations like the following.SELECT * FROM TESTTB2 WHERE (COL1 IN (‘A', ‘B', ‘F') AND COL1 NOT IN (‘X','Y','Z') OR COL1 <> ‘R')
If the column
COL1 contained null(s), then the
NOT INtests did not work as expected.
In the SQL code I was fixing, the
SELECTmissed 49,000 records that the programmer thought were being selected! The take-away message is that SQL requires attention to detail that often is not realized by the hobbyist programmer.