I've just started using Sqlite and something seems wrong. I'm sure I'm making
a mistake, but can't spot it.

I have a process that loads data from an RSS feed into a database.  All the
columns are defined as VARCHAR(255) but I figure that's irrelevant here
based on what I've read about dynamic type support. 

If I do this query:


  select name, servings from recipe where servings >= 100


I get back dozens of records rather than the 3 I ought to get. As you can
see none of these records have "servings" over 100. Here are some examples: 


  Barbeque Beef Sandwiches|8
  Green Turkey Chili|4
  Thai Chicken Legs|4
  Hungarian Beef Stew|6


But if I do it like this


  select name, servings from recipe where (1 * servings) >= 100


the right records back. Doing an EXPLAIN on the queries shows a MUL and INT
operation, so I assume it's something to do with type conversions. Am I
misunderstanding how the dynamic type conversion is supposed to work?

I've tried both 3.4.0 and 3.6.11 with the same results. I've also tried
creating a small example with three records (same column definitions,
numeric values inserted as string literals) but it won't reproduce the
problem.

Thanks for any help you can provide.


-- 
View this message in context: 
http://www.nabble.com/WHERE-clause-doesn%27t-seem-to-work-right-tp22497543p22497543.html
Sent from the SQLite mailing list archive at Nabble.com.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to