将一个表(A)中字段(F)为纯数字的记录查询出来Select * FROM A Where IsNumeric(F) = 1

解决方案 »

  1.   

    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
    */
      

  2.   

    select * from renwuk where IsNumeric(id) =1
      

  3.   

    Select * From 表名 Where IsNumeric(字段名) = 1
      

  4.   

    select * from renwuk where IsNumeric(id) =1可以哦?
      

  5.   

    谢谢各位
    IsNumeric(id) =1 正解但还是想知道, 有没有像正则表达式中 "[0-9]+" 一样的配置,比如我想查询 以数字开头的,或者 中间包含两个数字的等
      

  6.   

    paoluo(一天到晚游泳的鱼) ( ) 信誉:100    BloG
      

  7.   

    试一下:SELECT * FROM A WHERE F LIKE '[0-9]%'and IsNumeric(F) = 1