licheng700

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

          我的評論

          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
          re: java.util.StringTokenization 小海船 2005-08-08 10:25  
          可以直接用String.split()
          主站蜘蛛池模板: 凌云县| 乐平市| 三门峡市| 冕宁县| 年辖:市辖区| 万荣县| 广德县| 洛南县| 育儿| 新昌县| 丰城市| 泌阳县| 常德市| 宁南县| 合阳县| 剑阁县| 青川县| 武宣县| 修水县| 鄂托克旗| 集安市| 永济市| 呼图壁县| 浪卡子县| 三亚市| 灯塔市| 施秉县| 抚顺市| 奎屯市| 嘉祥县| 额敏县| 永泰县| 乃东县| 高邮市| 夹江县| 富源县| 浦江县| 连江县| 沭阳县| 溧水县| 潜山县|