> Depending on how you store your values you could have a column with both floats and ints where a simple query like 'number < 10' will result in weird results
Can you specify what weird results you got?
Can you specify what weird results you got?
sqlite> .import /dev/stdin t
x
1
2
sqlite> select * from t where x < 10;
1
sqlite> select * from t where x > 10;
2In schemas, when you define a column as integer or float, input is interpreted this way WHEN POSSIBLE (i.e. with 1 and 2 it's possible, but if you pass "foo" it'll be stored as a text attribute, obviously).
What people should know with SQLite is that it's flexible about types, and stores everything you pass, but it still cares what the column type is and it affects how it interprets input.
and flexible how. What caught me off-guard is that I thought that since the types aren't specified with .import, sqlite would behave like how it does when you create a table without specifying the types:
sqlite> create table t(x);
sqlite> insert into t values (1), (2);
sqlite> select * from t where x < 10;
1
2
sqlite> select * from t where x > 10;
But that's not the case. It behaves like the types were explicitly set as text: sqlite> create table t(x text);
sqlite> insert into t values (1), (2);
sqlite> select * from t where x < 10;
1
sqlite> select * from t where x > 10;
2