select a.wzid00,a.WZDMBM, a.WZMC00, trim(a.GG0000)||trim(a.WZXH00) as GGXH00, a.GG0000, b.WZDW00, a.CGJ000, a.JCS000, a.QRJCJE as JCJE00, b.WBSM00,b.PYSM00, a.LSJ000,a.LSJE00 from VW_WZ_WZMXZ0 a,BM_WZDM00 b where a.WZDMID=b.WZDMID and a.WZDMBM like '%' and a.MXZLSH in (select max(MXZLSH) from WZ_WZMXZ0 where QRRQ00<='20201010' and QRRQ00||QRSJ00<='2020101010:20:57' and KCBMBH=228 and ZY0000 not like '初期数%' and ZY0000 not like '期初数%' group by WZID00) order by a.WZDMBM