select max(id)+1 from table

解决方案 »

  1.   

    select max(id)+1 from table
      

  2.   

    write your sql statement like this :
    -----------------------------------------------------------
    insert into table (column list) values (values list);
    select @@identity
    -----------------------------------------------------------
    the @@identity is a system global viriable to save the new id value.
      

  3.   

    select max(id)+1 from table
    max(id) 取出当前最大的值,+1即得到 下个值
      

  4.   

    xport(郁闷中...)的方法正确,不过如果是mission critical 的系统中要再考虑