select bd_glorgbook.glorgbookcode,bd_glorgbook.glorgbookname, gl_detail.explanation, bd_accsubj.dispname, gl_detail.debitamount 借方, gl_detail.creditamount 贷方, gl_detail.prepareddatev 制单日期, gl_voucher.no 凭证号, wmsys.wm_concat(gl_freevalue.valuecode) valuecode, wmsys.wm_concat(gl_freevalue.valuename) valuename, gl_detail.pk_systemv, gl_detail.detailindex from bd_accsubj join gl_detail on gl_detail.pk_accsubj = bd_accsubj.pk_accsubj join bd_glorgbook on bd_glorgbook.pk_glorgbook = bd_accsubj.pk_glorgbook join gl_voucher on gl_detail.pk_voucher = gl_voucher.pk_voucher left join gl_freevalue on gl_detail.assid = gl_freevalue.freevalueid where gl_detail.dr = ‘0‘ and ( bd_accsubj.subjcode like ‘4104010508%‘or bd_accsubj.subjcode like ‘550212%‘) and bd_glorgbook.glorgbookcode like ‘01%-0001‘ and gl_detail.yearv = ‘2013‘ /* and gl_detail.creditamount =‘0‘*/ and gl_detail.explanation<>‘期初‘ and gl_detail.debitamount<>0 /* and gl_detail.explanation=‘付财大凤凰楼项目人工费(洪荣森)‘*/ --and bd_accsubj.subjcode like ‘150103%‘ group by bd_glorgbook.glorgbookcode,bd_glorgbook.glorgbookname, gl_detail.explanation, bd_accsubj.dispname, gl_detail.creditamount, gl_detail.debitamount, gl_detail.prepareddatev, gl_voucher.no, gl_detail.pk_systemv, gl_detail.detailindex order by bd_glorgbook.glorgbookcode, bd_accsubj.dispname,gl_detail.prepareddatev, gl_voucher.no