|
楼主 |
发表于 2020-6-12 07:59:28
|
显示全部楼层
已经复制过其这客户端的,也不行,而且同一个用户在不同的电脑上点击科目明细账出来的SQL语句不一样
Select NR.KJQJ, CASE NR.PZLY WHEN '_' THEN ' ' ELSE NR.PZLY END PZLY1 , NR.PZLY,NR.PZLXDM,NR.IDPZH,NR.PZH,Case when NR.PZLXDM<>'_' then NR.PZLXDM+right(' '+NR.PZH,6) else NR.PZH end PZH1,1 flh,' ' SPZ, ' ' JSFS, min(NR.ZY) zy,nr.kmdm,' ' bmdm,' ' xmdm,' ' zydm,' ' wldm,' ' fzdm4,' ' fzdm5,' ' fzdm6,' ' fzdm7,' ' fzdm8,' ' fzdm9,' ' fzdm10,' ' fzdm11,' ' fzdm12,' ' fzdm13,' ' fzdm14,' ' fzdm15,' ' fzdm16,' ' fzdm17,' ' fzdm18,' ' fzdm19,' ' fzdm20,' ' fzdm21,' ' fzdm22,' ' fzdm23,' ' fzdm24,' ' fzdm25,' ' fzdm26,' ' fzdm27,' ' fzdm28,' ' fzdm29,' ' fzdm30,NR.WBDM,avg(NR.HL) hl, case when sum(NR.SL)=0 then 0 else Round(sum(NR.JE)/sum(NR.SL), 2) end dj,ML.ZT,NR.KJTXDMNR.JDBZ,sum(NR.WBJE) wbje,sum(NR.JE) je,sum(NR.SL) sl,ML.PZRQ,KM.KMDW,KM.KMMC,KM.KMLB
from GL_PZNR NR,GL_PZML ML,GL_KMXX KM where NR.GSDM='101' and ML.ZTH='101' and NR.ZTH='101' and ML.ZT=3 and NR.KJQJ>='202004' and NR.KJQJ<='202004' and KM.ZTH='101' and KM.GSDM='101' and KM.KJND='2020' and NR.GSDM=ML.GSDM and NR.KJQJ=ML.KJQJ and NR.PZLY=ML.PZLY and NR.PZLXDM=ML.PZLXDM and NR.PZH=ML.PZH
and KM.GSDM=ML.GSDM and KM.KMDM=NR.KMDM AND KM.ZTH=NR.ZTH AND ML.ZTH=NR.ZTH and NR.KMDM like '10020102%' and NR.WBDM='' and not exists (select qxkz.kzdm from gl_qxkz qxkz where (qxkz.UserID=1) and (qxkz.kzlx='K') and NR.KMDM=qxkz.kzdm) group by NR.KJQJ,NR.PZLY,NR.PZLXDM,nr.pzh,NR.WBDM,ML.ZT,NR.KJTXDM,NR.JDBZ,ML.PZRQ,KM.KMDW,KM.KMMC,KM.KMLB,NR.IDPZH,nr.kmdm,NR.GSDM order by NR.KJQJ,ML.PZRQ,NR.PZLXDM desc,PZH1
|
|