JUST DO IT ~

我只想当个程序员

oracle case 函数 写法 2 种

      


         
case  
              
when  ( zjcj_ =  0 ) or  (zrsp_ = 0 )  then  0 
              
else   ln ( zjcj_ / zrsp_)  
              
end  , -- ln 复权当日收益率   老算法  d.zjcj_ - d.rzrsp_






 
select 
 
case zjcj_
 
when    0 then  1 
 
else     8 
 
end   
 
from dl_hqk_his 
          where 1=1  and 'true' = ( case
               
when t.bssign_ = 0  and   t.ordbs_ in ('B','S'then   'true'
               
else 'false'
               
end)  ; 
                 


Oracle HowTo:如何使用Oracle case函数- Oracle Life



http://www.eygle.com/archives/2005/10/oracle_howto_user_case_function.html

posted on 2007-11-28 11:26 小高 阅读(1035) 评论(2)  编辑  收藏 所属分类: Oracle

评论

# re: oracle case 函数 写法 2 种 2010-12-24 15:19 ggggggggggg

gg  回复  更多评论   

# re: oracle case 函数 写法 2 种 2010-12-24 15:21 JoNllen

另一种写法是:
case errorcode when ''DELIVRD'' then 1 when ''0'' then 1 else null end  回复  更多评论   


只有注册用户登录后才能发表评论。


网站导航:
 

导航

<2010年12月>
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

统计

常用链接

留言簿(3)

随笔分类(352)

收藏夹(19)

关注的blog

手册

搜索

积分与排名

最新评论

阅读排行榜

评论排行榜