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
For integer strings, test whether the roundtrip CAST matches the original string:
SELECT * FROM mytable WHERE cast(cast(mycolumn AS INTEGER) AS TEXT) = mycolumn
For consistently-formatted real strings (for example, currency):
SELECT * FROM mytable WHERE printf("%.2f", cast(mycolumn AS REAL)) = mycolumn
Input values:
-number
rather than (number)
.