当前位置: 代码迷 >> DB2 >> SQL话语转换
  详细解决方案

SQL话语转换

热度:2218   发布时间:2013-02-26 00:00:00.0
SQL语句转换
update (select a.bidformula, a.askformula, b.engname from xprice_fpfeedparam a, param_ccypair b
  where a.ratecode = b.CCYPAIRID and a.termid = 1 and b.engname like '%USD%') c
set c.bidformula = '0-|1_' || c.engname || '_O/N' || '_ASK|-|1_' || c.engname || '_T/N_ASK|' ,
  c.askformula = '0-|1_' || c.engname || '_O/N' || '_BID|-|1_' || c.engname || '_T/N_BID|';


上面的语句在oracle中能正常执行,如何将它改成DB2能支持的语句

------解决方案--------------------------------------------------------

update xprice_fpfeedparam a
set bidformula = '0-|1_' || (select engname from param_ccypair where a.ratecode = CCYPAIRID and a.termid = 1 and engname like '%USD%') || '_O/N' || '_ASK|-|1_' || select engname from param_ccypair where a.ratecode = CCYPAIRID and a.termid = 1 and engname like '%USD%') || '_T/_ASK|' ,
askformula = '0-|1_' || select engname from param_ccypair where a.ratecode = CCYPAIRID and a.termid = 1 and engname like '%USD%') || '_O/N' || '_BID|-|1_' || select engname from param_ccypair where a.ratecode = CCYPAIRID and a.termid = 1 and engname like '%USD%') || '_T/N_BID|';
  相关解决方案