<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    JUST DO IT ~

    我只想當個程序員

    oracle 多條 變 一條 group count(*) 匯集成 1條


    oracle
       

    insert  table1
    select  name ,count(*)
    from ...
    group by  type


    select            ,case type1  ==  value1  , case type2 == value2  , case  type3 = value3  .........這里也要寫死的
    from table2 , table1

    導入到臨時表   1:N 然后拼接出一張表 寫1次固定代碼

    還沒想到更好的...................????????






    其他方式

    select     ......
    from a
    ( select  * ,count   from  ...   where   type1  ) t1
    ( select  * ,count   from  ...   where   type2  ) t2
    .
    .
    .
    .

    有幾種就要寫幾種.... 但是速度如何呢? 要發動N次的 index count(*)   寫2次固定代碼



    1-1-1-N
    可能因為 不是3,6 整天記錄都不輸出  問題是怎么解決 .



      
    select
           a.seatid_      "xwh" ,      
    --席位
           b.exchgcode_  "jys"    , --交易所
           b.holderacc_ "khh",        --客戶號
           c.password_ "khmm" ,   -- 密碼
           count(*)     "num"  ,  
           
    case  
                
    when  count(*= 0   then   'N'    --不讀回報 沒有未完成的委托
                else    'Y'                        -- 有未完成的委托 
           end    "qbh"                -- 取回報
          from acc_seat a, acc_holder2seat b , acc_holder c ,dl_entrust  d
         
    where a.exchgcode_ =  v_exchgcode
           
    and a.seatid_ =  v_seatid
           
    and a.exchgcode_ = b.exchgcode_
           
    and a.seatid_ = b.seatid_
           
    and b.exchgcode_ =c.exchgcode_
           
    and b.holderacc_ =c.holderacc_ 
           
    and d.exchgcode_ = a.exchgcode_ 
           
    and d.seatid_ = a.seatid_ 
           
    and d.holderacc_  = b.holderacc_ 
           
    and d.entstatus_ not in (3,6)    
         
    group by        a.seatid_    ,      --席位
           b.exchgcode_      , --交易所
           b.holderacc_  ,        --客戶號
           c.password_ ;  -- 密碼 



      select
           a.seatid_      "xwh" ,      
    --席位
           b.exchgcode_  "jys"    , --交易所
           b.holderacc_ "khh",        --客戶號
           c.password_ "khmm" ,   -- 密碼
          nvl( (
           
    select  count(*
           
    from  dl_entrust  d
           
    where  1=1    and d.exchgcode_ = a.exchgcode_ 
           
    and d.seatid_ = a.seatid_ 
           
    and d.holderacc_  = b.holderacc_ 
           
    and d.entstatus_ not in (3,6)    
           ),
    0 )     "num"    

      
          
    from acc_seat a, acc_holder2seat b , acc_holder c  
         
    where a.exchgcode_ =  &v_exchgcode
           
    and a.seatid_ =  &v_seatid
           
    and a.exchgcode_ = b.exchgcode_
           
    and a.seatid_ = b.seatid_
           
    and b.exchgcode_ =c.exchgcode_
           
    and b.holderacc_ =c.holderacc_ 




    posted on 2008-09-08 08:03 小高 閱讀(681) 評論(0)  編輯  收藏 所屬分類: Oracle

    導航

    <2008年9月>
    31123456
    78910111213
    14151617181920
    21222324252627
    2829301234
    567891011

    統計

    常用鏈接

    留言簿(3)

    隨筆分類(352)

    收藏夾(19)

    關注的blog

    手冊

    搜索

    積分與排名

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 亚洲精品视频在线免费| 精品视频一区二区三区免费| 久久亚洲AV成人出白浆无码国产| 国产大片91精品免费看3| 免费在线观看h片| 两个人看的www高清免费观看| 老司机午夜在线视频免费| 一本色道久久88—综合亚洲精品| 亚洲视频国产视频| 亚洲成亚洲乱码一二三四区软件| 亚洲第一永久AV网站久久精品男人的天堂AV | 亚洲成a人无码亚洲成av无码| 亚洲国产精品综合一区在线| 国产亚洲A∨片在线观看| 亚洲国产精品尤物YW在线观看| 免费黄色一级毛片| 24小时日本在线www免费的| 18禁黄网站禁片免费观看不卡| 日韩电影免费在线观看| a视频免费在线观看| 五月天婷婷免费视频| 久久久久亚洲AV无码去区首| 中文字幕无码精品亚洲资源网久久| 亚洲美女色在线欧洲美女| 亚洲av日韩av高潮潮喷无码| 国产精一品亚洲二区在线播放| 亚洲精品国产精品乱码视色 | jizz免费在线观看| 免费无遮挡无遮羞在线看| 人人狠狠综合久久亚洲| 久久久久亚洲AV无码去区首| 极品色天使在线婷婷天堂亚洲| 亚洲日韩亚洲另类激情文学| 亚洲乱码日产精品一二三| 色天使亚洲综合在线观看| 亚洲中文无码卡通动漫野外| 亚洲色精品VR一区区三区| 亚洲美国产亚洲AV| 免费高清A级毛片在线播放| 美女黄频视频大全免费的| 一级黄色毛片免费看|