怎么把表A的qh和dq对应到表B中?表b中前面的几位是表示区号的.2个表.表a           表b
qh   dq             qh  dq   tel
023  重庆                    0281251212
028  成都                    0231545
表B中的现在的qh和dq目前为空.

解决方案 »

  1.   

    update 表b
    set qh=表A.qh, dq=表A.dq
    wher 表b.tel like 表A.qh
      

  2.   

    update 表b
    set qh=表A.qh, dq=表A.dq
    where 表b.tel like 表A.qh
      

  3.   

    update 表b
    set qh=表A.qh, dq=表A.dq
    where 表b.tel like 表A.qh
      

  4.   

    update 表b set 表b.dq=(select dq from 表a where qh=substring(表b.tel,1,3))
      

  5.   

    update b
       set b.qh = a.qh,
           b.dq = a.dq
      from a, b
     where b.tel like a.qh + '%'
      

  6.   

    hujsf(风)的sql在oracle中执行时提示:ORA-00933: SQL 命令未正确结束
      

  7.   

    我上面得是SYBASE 和 SQL 中的执行语句。 
    ORACLE中的执行方式应该是:
    update b
       set b.qh = (select a.qh from a where b.tel like a.qh || '%');update b
       set b.dq = (select a.dq from a where b.tel like a.qh || '%');刚刚接触ORACLE,不好意思!:)
      

  8.   

    ORA-01427: 单行子查询返回多于一个行