首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > IBM DB2 >

SQL话语转换

2012-08-28 
SQL语句转换update (select a.bidformula, a.askformula, b.engname from xprice_fpfeedparam a, param_cc

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|';

热点排行