select * from bdcdj.lqentry1 a where 顺序号 in (select max(顺序号) from bdcdj.lqentry1 b WHERE b.archival_code IS NOT NULL group by archival_code);通过archival_code分组 ,取顺序号的最大值。