当前位置: 代码迷 >> Oracle管理 >> oracle函数施用
  详细解决方案

oracle函数施用

热度:11   发布时间:2016-04-24 04:43:47.0
oracle函数使用
传入一个表中字段   如果该字段大于5怎返回3  如果小于5则返回4   这个函数怎么写
大虾们  求指教   

------解决方案--------------------
select decode(sign(num-5),1,3,-1,4,default_num) as num from tablename

------解决方案--------------------
select case when f1>5 then 3 when f1<5 then 4 end from t
  相关解决方案