How to select only numeric values

JetJack picture JetJack · Sep 30, 2012 · Viewed 87.1k times · Source

Table1

id

01
wire
02
steve
ram123
03
....

from the table1 i want to select only numeric values, It should not display alphanumeric values like (ram123)

Expected Output

01
02
03
....

How to make a query for this condition

Answer

John Woo picture John Woo · Sep 30, 2012

Try ISNUMERIC

SELECT *
FROM Table1
WHERE ISNUMERIC([ID]) = 1

SQLFiddle Demo