I should have added that I have database with lots of values like this and I 
run many queries like this.  Sometimes sqlite returns the correct results and 
sometimes it includes results where the values are equal to the base or base - 
thick.  It probably returns the correct result a little over the half the time.

-----Original Message-----
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of Ryan Belcher
Sent: Tuesday, November 01, 2011 10:35 AM
To: sqlite-users@sqlite.org
Subject: [sqlite] Occasional problems with < and >

Sometimes queries using < and > will include values that are equal.  Here is an 
example.

SELECT id,base,thick FROM test_col WHERE base > 281.01 AND base - thick < 
283.11;

Id|base|thick
89|281.04|0.03
90|282.09|1.05
91|283.11|1.02
92|290.08|6.97

For that last result, 290.08 - 6.97 = 283.11; so base - thick is equal to 
283.11 but not less.  Is this a bug or something I'm not doing right or don't 
understand?

________________________________
This communication contains information which is confidential and may also be 
privileged. It is for the exclusive use of the intended recipient(s). If you 
are not the intended recipient(s), please note that any distribution, copying 
or use of this communication or the information in it is strictly prohibited. 
If you have received this communication in error, please notify the sender 
immediately and then destroy any copies of it.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

This communication contains information which is confidential and may also be 
privileged. It is for the exclusive use of the intended recipient(s). If you 
are not the intended recipient(s), please note that any distribution, copying 
or use of this communication or the information in it is strictly prohibited. 
If you have received this communication in error, please notify the sender 
immediately and then destroy any copies of it.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to