<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

    手冊

    搜索

    積分與排名

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 色欲aⅴ亚洲情无码AV蜜桃| 亚洲AV色吊丝无码| 一级成人毛片免费观看| 精品久久洲久久久久护士免费 | 亚洲精品中文字幕乱码三区| 青青视频免费在线| 亚洲精品国产精品乱码不卞| 曰批免费视频播放免费| 亚洲精品国产日韩无码AV永久免费网| 久香草视频在线观看免费| 亚洲成av人片在线观看天堂无码| 曰批全过程免费视频观看免费软件| 免费在线观看中文字幕| 日韩精品视频在线观看免费 | 亚洲成色在线影院| 无码精品人妻一区二区三区免费看| 亚洲欧洲在线观看| 最近中文字幕高清免费中文字幕mv | 99在线观看视频免费| 亚洲国产视频一区| 免费观看毛片视频| 美女啪啪网站又黄又免费| 亚洲?v无码国产在丝袜线观看 | 亚洲色欲色欲www在线丝 | 特级毛片在线大全免费播放| 久久久久国产亚洲AV麻豆| 一区二区三区无码视频免费福利 | 国产大片91精品免费观看不卡| 亚洲av乱码一区二区三区| 在线观看免费污视频| 一级黄色片免费观看| 亚洲综合视频在线| 香蕉视频在线观看免费国产婷婷| 一个人免费播放在线视频看片 | 豆国产96在线|亚洲| 亚洲中文字幕不卡无码| 免费三级毛片电影片| 国产亚洲精品成人久久网站| 亚洲成AV人片在线观看| 日韩免费福利视频| 国产白丝无码免费视频|