I have a column that contains numbers and other string values (like “?”, “???”, etc.)
Is it possible to add an “is number” condition to the where clause in SQLite? Something like:
select * from mytable where isnumber(mycolumn)
Advertisement
Answer
From the documentation,
The typeof(X) function returns a string that indicates the datatype of the expression X: “null”, “integer”, “real”, “text”, or “blob”.
You can use where typeof(mycolumn) = "integer"