SQLite: does data type depend on the quotes?
Posted
by
Septagram
on Stack Overflow
See other posts from Stack Overflow
or by Septagram
Published on 2010-12-27T05:48:50Z
Indexed on
2010/12/27
5:54 UTC
Read the original article
Hit count: 186
sqlite
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?)?
© Stack Overflow or respective owner