CREATE CURSOR sfz (姓名 c(10), sfzh c(18))
INSERT INTO sfz VALUES ("01", "12a")
INSERT INTO sfz VALUES ("02", "12b")
INSERT INTO sfz VALUES ("03", "12c")
INSERT INTO sfz VALUES ("04", "12d")
INSERT INTO sfz VALUES ("05", "12a")
INSERT INTO sfz VALUES ("06", "12d")
SELECT * FROM sfz WHERE sfzh in (SELECT sfzh FROM sfz GROUP BY sfzh HAVING COUNT(*) > 1) ORDER BY sfzh
INSERT INTO sfz VALUES ("01", "12a")
INSERT INTO sfz VALUES ("02", "12b")
INSERT INTO sfz VALUES ("03", "12c")
INSERT INTO sfz VALUES ("04", "12d")
INSERT INTO sfz VALUES ("05", "12a")
INSERT INTO sfz VALUES ("06", "12d")
SELECT * FROM sfz WHERE sfzh in (SELECT sfzh FROM sfz GROUP BY sfzh HAVING COUNT(*) > 1) ORDER BY sfzh
坚守VFP最后的阵地