Create Table A (F Varchar(10)) Insert A Select '21321' Union All Select '21321DSDS' Union All Select 'DSDS' Union All Select 'svasd' Union All Select 'svasd21321' Union All Select '586' GO Select * FROM A Where IsNumeric(F) = 1 Go Drop Table A /* F 21321 586 */
(F Varchar(10))
Insert A Select '21321'
Union All Select '21321DSDS'
Union All Select 'DSDS'
Union All Select 'svasd'
Union All Select 'svasd21321'
Union All Select '586'
GO
Select * FROM A Where IsNumeric(F) = 1
Go
Drop Table A
/*
F
21321
586
*/
IsNumeric(id) =1 正解但还是想知道, 有没有像正则表达式中 "[0-9]+" 一样的配置,比如我想查询 以数字开头的,或者 中间包含两个数字的等