select ilMCU,GLEXR,GLEXA,GLANI,GLDCT,GLDOC,GLDGJ,sum(GLAA),SUM(ILPAID) from crpdta.f0911 left join crpdta.f4111 on GLKCO=ILKCO and GLDOC=ILDOC WHERE LTRIM(RTRIM(GLANI)) = '10.1403.01' AND GLSUB='01' and ILDCT<>'IT' and ILDCT<>'RI' and gLDCT<>'IT' and gLDCT<>'RI' group by ILMCU,GLEXR,GLEXA,GLANI,GLDCT,GLDOC,GLDGJ,GLAA having sum(ILPAID)<>sum(GLAA) 注意修改红色字体部分