select * from 表 where 字段 between 1000 and 3000 and isnumeric(字段)=1

解决方案 »

  1.   

    谢谢!~~但又出了点问题,呵呵错误:
    varchar 值 '11212131233' 的转换溢出了 int 列。超出了最大整数值。怎么转换成long型的呀?
      

  2.   

    select convert(bigint ,'11212131233')
      

  3.   

    select convert(float ,'11212131233')
      

  4.   

    create table test(
    num varchar(20)
    )
    insert into test
    select '1000' union all select '2000' union all select '2020' union all select '1千' union all select '112232132212'
    select * from test
    where isnumeric(num)=1 and cast(num as bigint) between 1000 and 3000
    drop table test
      

  5.   

    还是有些问题,不过还是谢谢 lianqizhi(油条豆腐脑) isnumeric(num)以前没用过