<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 小海船 閱讀(179) 評論(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原创免费 | 亚洲欧洲成人精品香蕉网| 精品免费AV一区二区三区| 日本免费福利视频| 亚洲AV无码片一区二区三区| 特级淫片国产免费高清视频| 色五月五月丁香亚洲综合网| 免费a级黄色毛片| 国产精品亚洲一区二区三区| 波多野结衣一区二区免费视频| 亚洲精品乱码久久久久久自慰| 亚洲男女性高爱潮网站| 2019中文字幕免费电影在线播放| 国产片免费在线观看| 免费精品视频在线| 亚洲乳大丰满中文字幕| 91av免费观看| 亚洲国产欧美一区二区三区| 国产片免费在线观看| 一区二区视频在线免费观看| 亚洲av日韩综合一区在线观看| 杨幂最新免费特级毛片| 亚洲一本大道无码av天堂| 色猫咪免费人成网站在线观看| 亚洲国产中文字幕在线观看 | 国产高清免费视频| 亚洲午夜无码久久| 亚洲人成网站在线观看青青| 青柠影视在线观看免费高清 | 一区二区三区在线观看免费| 亚洲国产成人片在线观看| 最近高清中文字幕免费| 亚洲精华国产精华精华液好用 | 国产青草亚洲香蕉精品久久 | 亚洲免费闲人蜜桃| 狼人大香伊蕉国产WWW亚洲| 国产国拍亚洲精品mv在线观看| 高潮内射免费看片| 久久青青草原亚洲AV无码麻豆 |