update select bom_opcomponent.bomid,bom_parent.bomid from bom_opcomponent inner join bom_parent on bom_opcomponent.bomid = bom_parent.parentid
where optionsid is null
set bom_opcomponent.bomid = bom_parent.bomid
当然我这个更新查询的方法不正确,运行错误,其实我的意思是,更新一个表的内容,等于另外一个表的内容,但是这两个表有连系,但不知道如何写,请高人赐教.

解决方案 »

  1.   

    --這樣?
    update bom_opcomponent
    set bom_opcomponent.bomid = bom_parent.bomid 
    from   bom_opcomponent inner join bom_parent on bom_opcomponent.bomid = bom_parent.parentid 
    where optionsid is null 
      

  2.   

    Update A
    Set A.F1 = B.F1,A.F2 = B.F2,.....
    From A inner join B on A.PK = B.PK
      

  3.   

    MS这样就可以鸟update bom_opcomponent set bom_opcomponent.bomid = bom_parent.bomid from bom_opcomponent inner join bom_parent on bom_opcomponent.bomid = bom_parent.parentid where optionsid is null
      

  4.   

    update bom_opcomponent
      set bomid=bom_parent.bomid
    from
      bom_opcomponent 
    inner 
      join bom_parent 
    on 
      bom_opcomponent.bomid = bom_parent.parentid
    where
      optionsid is null
      

  5.   

    我用以下SQL 语句测试了一下,结果发生错误
    update 出货明细1
    set 出货明细1.数量 = 出货明细.数量
    from 出货明细 inner join 出货明细1 on 出货明细.id=出货明细1.id
    显示语法错误
    这种更新理念是不是有问题哦
      

  6.   

    我想上传ACCESS附件,结果ACCESS 和 RAR格式都不允许,这该如何上传附件呀