一个简单问题:
假设有一个表A,主键为ID1,有一个字段DZCL;另一个表B,主键为ID2,有字段CL。现在想用A.ID1=B.ID2的B表里的数据CL,去替换A表里的DZCL,用一条SQL语句完成,请问怎么做?难住我了。

解决方案 »

  1.   

    update set a.dzcl=b.cl from A as a, B as b where a.id1=b.id2
      

  2.   

    update b set a.dzcl=b.dzcl from a,b where a.idl=b.id2
      

  3.   

    同意goldencity(响马) !
    呵呵,esu(ESU)大哥忘记了表名字啦
      

  4.   

    我们都是大意鬼!呵呵
    update b set a.dzcl=b.cl from a,b where a.idl=b.id2
      

  5.   

    update A set a.dzcl=b.cl from A, B where a.IDl=B.ID2
      

  6.   

    你们试了吗?我这里不管怎样都是一个"Sql command not proply ended";对了,我这里是ORACLE8.04