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 小高 閱讀(1050) 評論(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  回復  更多評論   

          導航

          <2007年11月>
          28293031123
          45678910
          11121314151617
          18192021222324
          2526272829301
          2345678

          統計

          常用鏈接

          留言簿(3)

          隨筆分類(352)

          收藏夾(19)

          關注的blog

          手冊

          搜索

          積分與排名

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 镇赉县| 三原县| 惠来县| 鹤山市| 康保县| 二连浩特市| 汨罗市| 綦江县| 集贤县| 萍乡市| 嫩江县| 沈丘县| 高安市| 无棣县| 会理县| 敦煌市| 盐城市| 进贤县| 高青县| 尚志市| 龙门县| 万盛区| 义乌市| 永安市| 巴林右旗| 南漳县| 民县| 平顺县| 大荔县| 略阳县| 新昌县| 时尚| 醴陵市| 七台河市| 白朗县| 安图县| 淮北市| 江陵县| 莱西市| 松滋市| 武功县|