In SQLite, the datatype of a value is associated with the value itself, not with the column type. So suppose we have a table with an integer primary key "id" and an integer column "some_number". If I do a query like this:
INSERT INTO mytable (id, some_number) VALUES (NULL, "1234")
Will 123 be inserted as an integer or as string? What consequences it will have later for me, say, when I'm comparing it with other value like "234" (as a number 1234 > 234, as a string "1234" < "234", right?)?
if your field type, (some_number), is numeric, then it will be inserted as a numeric value. No matter whether you put quotes.
if some_numeber is numeric
INSERT INTO mytable (id, some_number) VALUES (NULL, "1234")
and
INSERT INTO mytable (id, some_number) VALUES (NULL, 1234)
are same
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With