我的办法是选出第一条记录Select top 1,然后选取表中其它几个列名,这几个字段的值决定该条记录是唯一的。
通过这些字段来更新对应行的记录。
update pub_p_templated set id =id+ " + i + " where (templateid= ( select top 1 templateid from pub_p_templated where id=1) and itemid =(select top 1 itemid from pub_p_templated where id=1 ))"
这里选的字段是templateid和itemid
如果你有更好的办法就请教一下。