将concat值更新为单个列

时间:2013-07-27 04:32:21

标签: oracle oracle11g

我想将concat值更新为单个列。请帮我更新一下。

update tbl_data1 
   set FLD_REMARKS= 
       (select i.fld_id||':'||i.fld_calc_id||':'||0||':'||0 
          from tbl_cust_order p, tbl_cust_bill i 
         where i.fld_item_id=p.fld_id 
           and p.fld_item_id=110 
           and rownum =1 
         order by p.fld_id desc)
 where fld_id=243078

1 个答案:

答案 0 :(得分:0)

你没有说出问题所在,但也许这会有所帮助:

update tbl_data1 
   set FLD_REMARKS= 
     (select TheFld FROM (
       (select i.fld_id||':'||i.fld_calc_id||':'||0||':'||0 TheFld
             , ROW_NUMBER() OVER (ORDER BY p.fld_id desc) rn 
          from tbl_cust_order p, tbl_cust_bill i 
         where i.fld_item_id=p.fld_id 
           and p.fld_item_id=110)
         WHERE rn = 1)
 where fld_id=243078