select *  from employ  where empcode >'10' 
  
  说明:empcode 为 varchar 型
       出现的结果是:
       empcode 
       
         2
         3
         4
         .
         .
         .
         10
         11
         12      
         .        
         .    我只想得到10以上的结果
   怎么解决?

解决方案 »

  1.   

    select *  from employ  where CAST(empcode AS int) >'10'
      

  2.   

    select *  from employ  where CAST(empcode AS int) > 10
      

  3.   

    select *  from employ  where CAST(empcode AS int) > 10
    right!
      

  4.   

    不对啊服务器: 消息 245,级别 16,状态 1,行 1
    将 varchar 值 'test' 转换为数据类型为 int 的列时发生语法错误。
      以上我是按照你门的写法在sql server 查询分析器中测试过,不行 啊
      

  5.   

    select * from employ where Len(empcode)>2