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

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

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

    licheng700

    BlogJava 首頁 新隨筆 聯系 聚合 管理
      26 Posts :: 5 Stories :: 5 Comments :: 1 Trackbacks

    select  n_accountid,accountNO,accountName ,
    sum(decode(n_direction,1,n_amount, 0)) amountOfDebit,
    sum(decode(n_direction,2,n_amount, 0)) amountOfCredit,
    sum(n_amount) amount,
    sum(decode(n_direction,1,1, 0)) numOfDebitTrans,
    sum(decode(n_direction,2,1, 0)) numOfCreditTrans,
    COUNT(n_direction) nums
    from

    (select a.n_accountid n_accountid ,
    a.n_amount n_amount,a.n_direction n_direction,
    b.s_accountno accountNO,b.s_accountname  accountName from

    (select n_id ,n_accountid,n_currencytype,n_amount,n_direction,dt_modifytime from bs_accthistransinfo where 1=1
     and to_char(dt_modifytime,'yyyy-mm-dd')>='2005-01-01'
     and to_char(dt_modifytime,'yyyy-mm-dd')<='2006-01-01'
     union all
    select n_id ,n_accountid,n_currencytype,n_amount,n_direction,dt_modifytime from bs_acctcurtransinfo where 1=1
     and to_char(dt_modifytime,'yyyy-mm-dd')>='2005-01-01'
     and to_char(dt_modifytime,'yyyy-mm-dd')<='2006-01-01'
    )a,  

    (select n_id,s_accountno,s_accountname,n_currencytype from bs_bankaccountinfo where
        n_ischeck=1
     and n_accountstatus= 1)
     b
     where a.n_currencytype=b.n_currencytype  and a.n_accountid=b.n_id
    )
    c
    group by n_accountid,accountNO,accountName


     

    posted on 2005-08-25 16:31 小海船 閱讀(181) 評論(1)  編輯  收藏

    評論

    # re: 一段SQL 2005-08-25 17:02 小海船
    select n_accountid,accountNO,accountName ,
    sum(decode(n_direction,1,n_amount, 0)) amountOfDebit,
    sum(decode(n_direction,2,n_amount, 0)) amountOfCredit,
    sum(n_amount) amount,
    sum(decode(n_direction,1,1, 0)) numOfDebitTrans,
    sum(decode(n_direction,2,1, 0)) numOfCreditTrans,
    COUNT(n_direction) nums
    from
    (select a.n_id n_id,a.n_accountid n_accountid ,a.n_currencytype n_currencytype,
    a.n_amount n_amount,a.n_direction n_direction,a.dt_modifytime dt_modifytime,
    b.s_accountno accountNO,b.s_accountname accountName from
    (select n_id ,n_accountid,n_currencytype,n_amount,n_direction,dt_modifytime from bs_accthistransinfo where 1=1
    union all
    select n_id ,n_accountid,n_currencytype,n_amount,n_direction,dt_modifytime from bs_acctcurtransinfo where 1=1)
    a,
    (select * from bs_bankaccountinfo where
    n_accountstatus= 1
    and n_ischeck=1) b where a.n_currencytype=b.n_currencytype and a.n_accountid=b.n_id and
    to_char(a.dt_modifytime,'yyyy-mm-dd')>='2005-01-01' and
    to_char(a.dt_modifytime,'yyyy-mm-dd')<='2006-01-01'
    )c group by n_accountid,accountNO,accountName  回復  更多評論
      


    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    主站蜘蛛池模板: 人与禽交免费网站视频| 久久精品乱子伦免费| 成年女性特黄午夜视频免费看| 亚洲av无码一区二区三区不卡| aa级女人大片喷水视频免费| 最新亚洲成av人免费看| 中国一级毛片免费看视频| 久久亚洲国产成人影院网站 | 日韩亚洲国产二区| 一级毛片aaaaaa视频免费看| 国产精品99久久免费| 理论亚洲区美一区二区三区 | 男女作爱在线播放免费网站| 亚洲国产精品无码av| 特级精品毛片免费观看| 亚洲特级aaaaaa毛片| 四虎国产精品免费久久| 亚洲精品又粗又大又爽A片| 国产美女做a免费视频软件| 成人国产网站v片免费观看| 国产亚洲精午夜久久久久久| 国产成人久久AV免费| 亚洲国产成人综合| 日韩特黄特色大片免费视频| 美女啪啪网站又黄又免费| 亚洲人成网77777亚洲色| 999任你躁在线精品免费不卡| 亚洲综合成人婷婷五月网址| 吃奶摸下高潮60分钟免费视频| 一级做a毛片免费视频| 久久夜色精品国产噜噜噜亚洲AV| 日本妇人成熟免费中文字幕 | 久久亚洲成a人片| 日韩版码免费福利视频| 黄页网站在线观看免费| 久久亚洲国产成人亚| 成年丰满熟妇午夜免费视频| 一个人看的在线免费视频| 亚洲视频国产视频| 国产成人免费全部网站| 日本免费大黄在线观看|