本帖最后由 wchis 于 2012-05-11 23:11:38 编辑

解决方案 »

  1.   

    既然XM和ID号是一一对应的
    update tb set xm=(select distinct xm from tb where ID号=8096)
    where ID号=109 and 项目代码 not in (select * from TABLE where ID号=8096)   
    ;
    commmit;
      

  2.   

    select '8096' id号,'xingming' XM,项目代码 
      from TABLE 
     where ID号=109 and 项目代码 not in (select * from TABLE where ID号=8096)不是很明白楼主要什么结果,
    是否是需要把ID号=109 的2000条记录抓出来,然后把名字和姓名变更为8096对应的然后其他字段一样的记录,并增加到表?