小编Drs*_*sin的帖子

ORA-00905:缺少关键字

我的表有以下列:

|blo|NotionalCurrency|Notional|Premiumcurrency|Basecurrency|Termcurrency|StructureName|Basemarketprice|Termmarketpriceprecent |Termmarketprice|
Run Code Online (Sandbox Code Playgroud)

我想从这些获得blo,货币和价格.下面是我的SQL:

   select blo.opt,
  case
  when opt.premiumcurrency is not null and opt.structurename is not null  then currency = opt.premiumcurrency
      case
      when opt.notionalcurrency = opt.basecurrency and opt.premiumcurrency = opt.termcurrency then price = opt.termmarketpricepercent / opt.notional
      else
          case
             when opt.premiumcurrency = opt.basecurrency then price = opt.basemarketprice /100
             else
             price = opt.termmarketpriceprecent /100
             end
       end
   when price = 0 then price = 0.000001
   end
FROM interface opt
WHERE opt.notionalcurrency = opt.basecurrency and opt.premiumcurrency = opt.termcurrency;
Run Code Online (Sandbox Code Playgroud)

但我得到错误: ORA-00905: missing keyword

基本上,下面的逻辑应该用于获取/派生SQL以获得三列:Blo,货币和价格:

If …
Run Code Online (Sandbox Code Playgroud)

sql oracle case

-3
推荐指数
1
解决办法
508
查看次数

标签 统计

case ×1

oracle ×1

sql ×1