SELECT B.XN,B.XH,B.XKKH,B.FXBJ,A.xh,count(A.xh) as 不及格门数 FROM ZFXFZB."CJBVIEW_XGB" A,"ZFXFZB"."XSXKB" B where A.XH=B.XH and A.XKKH=B.XKKH and A.XN='2017-2018' and B.FXBJ!='1' and A.CJ !='放弃' and A.CJ !='取消' and A.CJ is not null and A.ZSCJ<60 order by A.xh
这样定义就会报错java.lang.NullPointerException 去掉count(A.xh) as 不及格门数就是对的 不知道哪里写错了