update a set color=b.color from b,c where b.fid=c.colorid and a.carid=c.xuhao

解决方案 »

  1.   

    update a set color=b.color from a,b,c where a.carid=c.xuhao and c.colorid=b.fid
      

  2.   

    update a set color=b.fid from a join (b join c on b.fid=c.colorid) on a.carid=c.xuhao
      

  3.   

    select * from c left join a on c.xuhao=a.carid left join b on c.colorid=b.fid
      

  4.   

    修正一点,楼主要在A表中直接写color,建议写colorID:
    update a set color=c.colorid from a join c on  a.carid=c.xuhao
      

  5.   

    谢谢大力。顺便再问一个问题,如果我需要同时参照另外一个表d(象参照表b一样),是不是可以这样写:
    update a set color=b.color another=d.another from b,c,d where b.fid=c.colorid and a.carid=c.xuhao d.id=c.anotherid这里似乎不需要用什么inner join之类的东西,那么inner join什么的作用体现在什么地方那?
      

  6.   

    呵呵,正在试验大力的方法,一会儿就有这么多热心的朋友,也请大家讲一讲关于join的东西,总觉得不是很理解。
      

  7.   

    update a set color=d.color from a inner join (select xuhao,color from b inner join c on b.fid=c.colorid)D
    on a.carid=D.xuhao
      

  8.   

    update a set color=c.colorid from a join c on  a.carid=c.xuhao