How to check if a value is a number in SQLite

后端 未结 9 1994
-上瘾入骨i
-上瘾入骨i 2020-12-10 14:29

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 SQL

9条回答
  •  死守一世寂寞
    2020-12-10 15:16

    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"

提交回复
热议问题