where right(等级,len(等级)-1)>30

解决方案 »

  1.   

    select * from 表 where right(等级,len(等级)-1)>30
      

  2.   

    主要是你前缀有没有规律:如果都是P
    select * from table where cast(replace(等级,'p','') as decimal(10,2))>30
      

  3.   

    where 等级 > 'P30'
      

  4.   

    select * from 表 where cast(right(等级,len(等级)-1) as decimal(4,2)) > 30
      

  5.   

    create function getint(@ varchar(8000))
    returns int
    as
    begin
      while len(@)>0 and isnumeric(@)=0
        set @=right(@,len(@)-1)
    return @
    end 
    goselect dbo.getint('af45')
    go
    drop function getint
      

  6.   

    select * from XX where dbo.getint(列)>30