sql查詢工程結算分包款轉出

總一 借工程結算負數 貸工程結算對衝問題函數

oralce使用聚合函數wmsys.wm_concat字段顯示 clob :應該是,10.2.0.4之前,是varchar2,10.2.0.5開始,是CLOB 這是一個bug,當lob字段和order by 同時出現時可能觸發 能夠打上對應的補丁,或者,只要不超過4000字節,能夠加個to_char來轉換成字符串試試 spa

select gl_detail.explanation,
      bd_accsubj.subjcode,
      bd_accsubj.dispname,       
       gl_detail.debitamount 借方,   
        gl_detail.creditamount 貸方,
        gl_detail.prepareddatev 制單日期 , 
       gl_voucher.no 憑證號, 
       to_char(wmsys.wm_concat(gl_freevalue.valuecode)) valuecode,
        to_char(wmsys.wm_concat(gl_freevalue.valuename)) valuename
         from gl_detail, bd_accsubj, bd_glorgbook,gl_freevalue,gl_voucher
 where gl_detail.pk_accsubj = bd_accsubj.pk_accsubj
   and gl_detail.pk_glorgbook = bd_glorgbook.pk_glorgbook
   and   gl_detail.assid=gl_freevalue.freevalueid
   and gl_detail.pk_voucher=gl_voucher.pk_voucher
   and gl_detail.dr = '0'
   and gl_detail.yearv='2014'
   and bd_glorgbook.glorgbookcode = '015101-0001'
   and bd_accsubj.subjcode like '2123%' 
   and  gl_detail.creditamount<0
   group by gl_detail.explanation,
   bd_accsubj.subjcode,
         bd_accsubj.dispname,       
       gl_detail.creditamount,
       gl_detail.debitamount,   
         gl_detail.prepareddatev,gl_voucher.no
  order by gl_detail.prepareddatev,gl_voucher.no

相關文章
相關標籤/搜索