On Fri, Dec 6, 2013 at 1:13 PM, Scott Slater <sslat...@summitcn.com> wrote:
> Hello, > > I had a customer contact me that a report was randomly "missing data" and > have tracked down the problem to a single SQL query. the problem is that > some items, that logically match the WHERE clause don't get selected. > > I have put together a reverse logic of that statement below by changing > the = to != . I have attached a very small subset of this client's data > that demonstrates the problem. Using the attached file which contains 4 > orders none of which should get selected using the statement below; > > SELECT * FROM orders_tbl WHERE (ord_total+discount-tax1-tax2- > tax3-tax4-delivery_tax-delivery_fee)!=subtotal; > Are the values stored as floating point numbers? > > However, record #1 gets selected. If you change the != back to an =, then > you get the remaining 3. > > If you manually look through the relevant column data all 4 orders are > logically correct, and should be treated in the same manner by the select > statements. > > I have tested this on Windows machines and posted it to a forum where > another user was able to demonstrate the same issue. I have tried the > windows command shell version (sqlite3.exe / > sqlite-shell-win32-x86-3080200.zip) > as well as the sqlite3.dll / sqlite-dll-win32-x86-3080100.zip and an > earlier (not sure which) version of the dll. I have not tested on any > other operating systems. > > > Regards, > > Scott Slater > Summit Computer Networks, Inc. > (866) 922-9690 Ext. 7701 > (724) 779-6390 Ext. 7701 > sslat...@summitcn.com > > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > -- D. Richard Hipp d...@sqlite.org _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users