update F_USEABLE_FEE set a.admin_fee_rate=decode(b.product_id,13001,0.93,b.admin_fee_rate) 
from F_USEABLE_FEE a,t_group_policy_product b
where a.product_id=b.product_id
  and a.policy_id=b.policy_id
  and a.product_id in (13001,13016,13035,13002,13029)总是提示在from的位置上,ORA-00933:语句没有正确结束。求助.............

解决方案 »

  1.   

    update 语句在oracle中不允许from后面跟1张以上的表
    知道问题所在,你这个sql知道如何修改了吧!
      

  2.   

    update F_USEABLE_FEE a set a.admin_fee_rate=decode(b.product_id,13001,0.93,b.admin_fee_rate) 
    from t_group_policy_product b
    where a.product_id=b.product_id
      and a.policy_id=b.policy_id
      and a.product_id in (13001,13016,13035,13002,13029)也不行啊,奇怪
      

  3.   

    update table1 set table1.column1 =(select table2.column1 from table2 
    where 关联条件)
    where exists(select 1 from from table2 
    where 关联条件);
      

  4.   

    update   F_USEABLE_FEE   a   set   a.admin_fee_rate=select(decode(b.product_id,13001,0.93,b.admin_fee_rate)   
    from   t_group_policy_product   b )
    where   a.product_id=b.product_id 
        and   a.policy_id=b.policy_id 
        and   a.product_id   in   (13001,13016,13035,13002,13029) 
    看看这样行不行,没有update后面直接加from的
      

  5.   

    如果是select语句这样写没问题如果是update的话from后面必须是 tbl1 inner join tbl2 on a.product_id=b.product_id and a.policy_id=b.policy_id where a.product_id   in (13001,13016,13035,13002,13029)的形式我用的是sql server,Oracle的话可能某些关键字不一样
      

  6.   

    也就是说把连接条件和where后面的筛选条件分开的这种形式
      

  7.   

    主表要与从表关联进行更新,
    update F_USEABLE_FEE a
       set a.admin_fee_rate = (select decode(b.product_id,
                                             13001,
                                             0.93,
                                             b.admin_fee_rate)
                                 from t_group_policy_product b
                                where a.product_id = b.product_id
                                  and a.policy_id = b.policy_id)
     where a.product_id in (13001, 13016, 13035, 13002, 13029);
      

  8.   

    from 不能出现在 update 语句中,但可以出现在其中的子查询中。
    3楼的语法是正确的
      

  9.   

    前面好象说错了!没有你那样的写法,你的语句可以这样写update   F_USEABLE_FEE   set   (admin_fee_rate)=(select decode(b.product_id,13001,0.93,b.admin_fee_rate)   
    from   F_USEABLE_FEE   a,t_group_policy_product   b 
    where   a.product_id=b.product_id 
        and   a.policy_id=b.policy_id 
        and   a.product_id   in   (13001,13016,13035,13002,13029)
    )没测试,你可以试下
      

  10.   

    应该是这样吧
    update  F_USEABLE_FEE  a,t_group_policy_product b
    set  a.admin_fee_rate=decode(b.product_id,13001,0.93,b.admin_fee_rate) 
    where   a.product_id=b.product_id   
            and a.policy_id=b.policy_id   
            and a.product_id  in (13001,13016,13035,13002,13029) 
      

  11.   

    update F_USEABLE_FEE a set a.admin_fee_rate=decode(b.product_id,13001,0.93,b.admin_fee_rate)  
    where a.product_id=b.product_id 
      and a.policy_id=b.policy_id 
      and a.product_id in (13001,13016,13035,13002,13029) 
      

  12.   

    其它的不知道,如果是MS SQL2005 server  是可以在UPDATE直接跟FROM的.
      

  13.   

    。。
    这是什么时候的帖子了这是什么板块  MSQL or ORACLE……
      

  14.   

    -_-!没注意看~我查SQL资料时.GOOGLE进来的
      

  15.   

    update F_USEABLE_FEE a set a.admin_fee_rate=(select decode(b.product_id,13001,0.93,b.admin_fee_rate) 
    from t_group_policy_product b 
    where a.product_id=b.product_id 
      and a.policy_id=b.policy_id )
    where 
      a.product_id in (13001,13016,13035,13002,13029) 
      

  16.   

    把  decode(b.product_id,13001,0.93,b.admin_fee_rate) 
    from F_USEABLE_FEE a,t_group_policy_product b 
    where a.product_id=b.product_id 
      and a.policy_id=b.policy_id 
      and a.product_id in (13001,13016,13035,13002,13029) 
     变成子查询
      

  17.   

    把  decode(b.product_id,13001,0.93,b.admin_fee_rate) 
    from F_USEABLE_FEE a,t_group_policy_product b 
    where a.product_id=b.product_id 
      and a.policy_id=b.policy_id 
      and a.product_id in (13001,13016,13035,13002,13029) 
    变成子查询
      

  18.   

    from 不能出现在 update 语句中,但可以出现在其中的子查询中
      

  19.   

    updateF_USEABLE_FEEa,t_group_policy_productb
    seta.admin_fee_rate=decode(b.product_id,13001,0.93,b.admin_fee_rate)
    where a.product_id=b.product_id
    and a.policy_id=b.policy_id
    and a.product_idin(13001,13016,13035,13002,13029);
      

  20.   

    楼主是不是以前用MSSQL用多了