----查询重复生成凭证的单据selecth.pk_corp,h.caccountyear,h.caccountmonth,h.dbilldate,h.cbilltypecode,h.vbillcode,count(b.cbill_bid),sum(c.num)fromia_billh,ia_bill_bb,(selectdap.procmsgascbillbid,count(dap.pk_finindex)asnumfromdap_finindexdapwheredap.pk_sys='IA'anddap.dr=0groupbydap.procmsghavingcount(dap.pk_finindex)>1)cwhereh.cbillid=b.cbillidandb.cbill_bid=c.cbillbidgroupbyh.pk_corp,h.caccountyear,h.caccountmonth,h.dbilldate,h.cbilltypecode,h.vbillcode----查询重复生成凭证的单据行selecth.pk_corp,h.caccountyear,h.caccountmonth,h.dbilldate,h.cbilltypecode,h.vbillcode,b.irownumber,b.cbill_bid,b.cinventoryid,b.nprice,b.nmoney,c.numfromia_billh,ia_bill_bb,(selectdap.procmsgascbillbid,count(dap.pk_finindex)asnumfromdap_finindexdapwheredap.pk_sys='IA'anddap.dr=0groupbydap.procmsghavingcount(dap.pk_finindex)>1)cwhereh.cbillid=b.cbillidandb.cbill_bid=c.cbillbid