<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

    手冊

    搜索

    積分與排名

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 97碰公开在线观看免费视频| 国内精品免费视频精选在线观看| 在线观看视频免费完整版| 亚洲午夜精品久久久久久人妖| 国产a级特黄的片子视频免费| 亚洲人成网站18禁止久久影院| 亚洲国产综合AV在线观看| 无码视频免费一区二三区| 亚洲精品成人久久久| 亚洲精品黄色视频在线观看免费资源 | 久久免费精彩视频| 久久亚洲AV无码西西人体| 亚洲国产精品久久久久网站 | 久久久久久国产精品免费免费| 久久亚洲av无码精品浪潮| 中文字幕在线视频免费观看| 国产亚洲精品xxx| 亚洲AV无码无限在线观看不卡| 午夜视频在线观看免费完整版| 黑人粗长大战亚洲女2021国产精品成人免费视频 | 亚洲爆乳精品无码一区二区三区| 免费无码一区二区三区蜜桃| 精品少妇人妻AV免费久久洗澡| 亚洲AV无码专区电影在线观看| 免费精品无码AV片在线观看| 亚洲欧洲日本精品| 美女视频黄的免费视频网页| 亚洲综合自拍成人| 真实乱视频国产免费观看| 午夜不卡AV免费| 国产成人免费片在线视频观看| 免费很黄无遮挡的视频毛片| 国产AV无码专区亚洲AVJULIA| 国产曰批免费视频播放免费s| 99亚洲精品卡2卡三卡4卡2卡| 自拍偷自拍亚洲精品第1页| 黄色免费在线观看网址| 日美韩电影免费看| 免费h视频在线观看| 亚洲精品无码aⅴ中文字幕蜜桃| 亚洲精品乱码久久久久久|