How to check if a value is a number in SQLite

后端 未结 9 1977
-上瘾入骨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:29

    select * from mytable where abs(mycolumn) <> 0.0 or mycolumn = '0'
    

    http://sqlfiddle.com/#!5/f1081/2

    Based on this answer

提交回复
热议问题