码迷,mamicode.com
首页 > 数据库 > 详细

sql查询工程结算分包款转出

时间:2015-08-21 11:03:41      阅读:237      评论:0      收藏:0      [点我收藏+]

标签:

总一 借工程结算负数 贷工程结算对冲问题

oralce使用聚合函数wmsys.wm_concat字段显示 clob :应该是,10.2.0.4以前,是varchar2,10.2.0.5开始,是CLOB 这是一个bug,当lob字段和order by 同时出现时可能触发 可以打上对应的补丁,或者,只要不超过4000字节,可以加个to_char来转换成字符串试试 

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

技术分享

sql查询工程结算分包款转出

标签:

原文地址:http://www.cnblogs.com/sumsen/p/4746907.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!