我要更新数据库里的表,把表2的数据update到表1里面去,但是老是抱错,请教一下了!update table1 from table2 set table2.f_pro=table1.o_f_pro where table1.o_dateid='200606202422172' and table1.o_info_id=table2.info_id"

解决方案 »

  1.   

    update table2 set table2.f_pro=table1.o_f_pro FROM TABLE1,TABLE2 where table1.o_dateid='200606202422172' and table1.o_info_id=table2.info_id"
      

  2.   

    update table1 set table1.o_f_pro = (select table2.f_pro from table2 where table1.o_info_id=table2.info_id)
    where exists (select 1 from table2 where table1.o_info_id=table2.info_id and table1.o_dateid='200606202422172' )
      

  3.   

    oracle不支持update ... from 语法,必须用子查询来实现。
      

  4.   

    按照你的标题来说是INSERT INTO TABLE1 (COLUMN1, COL2......)SELECT (COL1,.....) FROM TABLE2 WHERE CONDITION;