CREATE CURSOR T (DZ C(2),DW C(1),XM C(4),NL I) INSERT INTO T VALUES ([aa],[1],[小孙],20) INSERT INTO T VALUES ([aa],[1],[小王],31) INSERT INTO T VALUES ([bb],[2],[小李],25) SELECT * FROM T where nl in (select max(nl) from t GROUP BY t.dw)