<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 小高 閱讀(682) 評論(0)  編輯  收藏 所屬分類: Oracle

    導航

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

    統計

    常用鏈接

    留言簿(3)

    隨筆分類(352)

    收藏夾(19)

    關注的blog

    手冊

    搜索

    積分與排名

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 又粗又黄又猛又爽大片免费 | 亚洲色大成网站www尤物| 亚洲欧洲日产国码一级毛片| 精品成在人线AV无码免费看| 久久精品成人免费国产片小草| 久久乐国产综合亚洲精品| 亚洲视频在线免费观看| 久久久久久亚洲精品不卡| 免费观看亚洲人成网站| 免费无码AV电影在线观看| 无码日韩精品一区二区三区免费| 日韩成人毛片高清视频免费看| 亚洲熟妇成人精品一区| 色拍自拍亚洲综合图区| 久久亚洲AV午夜福利精品一区| 亚洲第一页综合图片自拍| 性xxxx视频播放免费| av无码国产在线看免费网站| 久久国产精品萌白酱免费| 男女一进一出抽搐免费视频| 在线看亚洲十八禁网站| 亚洲熟妇久久精品| 亚洲中文无码永久免费| 亚洲天堂电影在线观看| 亚洲图片在线观看| 亚洲AV日韩精品久久久久久久| 中文字幕不卡亚洲| 久久久久久亚洲精品不卡| 亚洲精品无码久久不卡| 亚洲av无码乱码在线观看野外| 亚洲AⅤ优女AV综合久久久| 日韩人妻无码免费视频一区二区三区| 国产免费久久精品99re丫y| 四虎在线最新永久免费| 免费看黄视频网站| 国产精品免费观看久久| 在线观看免费污视频| 色吊丝最新永久免费观看网站| 免费高清在线爱做视频| 国产日产成人免费视频在线观看| 成人免费无毒在线观看网站|