假设现在想把表中[PK]字段等于1的所有记录找出...
既然是primary key,那么等于1的最多只有一条记录,更新了之后你必须要保证primary key 不能重复,即是表中不存在[PK]=2的记录你要的很简单:
update tablename set [PK]=[PK]+1 where [PK]=1

解决方案 »

  1.   

    既然是primary key,那么等于1的最多只有一条记录,更新了之后你必须要保证primary key 不能重复,即是表中不存在[PK]=2的记录
    ----------------------------------------------------
    就是的啊,没明白楼主的意思!
    如果表中不存在[PK]=[PK]+1的记录,可以用上面的那个更新语句
      

  2.   

    insert into tablename select [PK]+1,[col1],[col2],[col3]... where [PK]=1
      

  3.   

    insert into tablename (select [PK]+1,[col1],[col2],[col3]... from tablenmae where [PK]=1)