比如说:
我判断 a列 的值 大于 b列,select 则取 c 列
否则, select 结果选 d 列
用pl/sql developer 怎么实现啊
------解决方案--------------------
select case sign(a - b) when 1 then c else d end from table
------解决方案--------------------
一楼正解。也可以这样:
select decode(sign(a - b), 1, c, d) from table;
大同小异
------解决方案--------------------
也可以
select case when a > b then c else d end from table