create view aaa as
select jilh,zhih,yusp,xianj,yusp+xianj col1,pingjpj,(pingjpj*100)-(yusp+xianj) col2 from tshoupdjgl s 
left join
(select xianlcxdm,pingjpj from txianlcxxx where zhuangt='0') x 
on s.xianlh=x.xianlcxdm where mod((yusp+xianj),pingjpj)<>0 and caozlx='0';
update tshoupdjgl a set a.xianj=(select aaa.col2 from aaa where aaa.jilh=a.jilh)
where exists (select 1 from aaa where a.jilh=aaa.jilh);

解决方案 »

  1.   

    原来Oracle里也保留有Left Join关键字!
      

  2.   

    好像不用左连接  UPDATE tshoupdigl s 
       SET xianj = (( SELECT pingjpj
                       FROM txianlcxxx x
                      WHERE zhuangt='0'
                        AND s.jilh=x.jilh ) 
                    * 100 ) - (yusp + xianj)
     WHERE caozlx='0'
       AND EXISTS ( SELECT 1 FROM txianlcxxx xx
                     WHERE zhuangt='0'
                       AND s.jilh=xx.jilh
                       AND MOD((yusp+xianj),xx.pingjpj) <> 0 )
      

  3.   

    这oracle真是笨得死,我在SQL server里不费吹灰之力!那你就去用sqlserver咯了!