先转换成int后取max()
那样程序太慢了,要处理的太多。
我只要用SQL语句就要处理掉的。
select max(id) from rws

解决方案 »

  1.   

    不过像上面的SQL语句只能取出9,无法实现我的要求。请高手指点啊。
      

  2.   

    select max(cast(id as int)) from rws
      

  3.   

    先轉換數據類型
    select ID=max(cast(ID as int)) from tb
      

  4.   

    同意:
    select max(cast(id as int)) from rws
      

  5.   

    select max(cast(id as int)) from rws
      

  6.   

    select max(cast(id as int)) from tablename
      

  7.   

    有两种方式可以实现:
    select max(cast(id as int)) from tablename
    select max(convert(int,id)) from tablename