CREATE CURSOR tt (省份 C(10), 城市 C(10), 员工 C(10))
INSERT INTO tt VALUES ("福建省", "福州市", "张三")
INSERT INTO tt VALUES ("福建省", "福州市", "李四")
INSERT INTO tt VALUES ("山东省", "济南市", "王五")
INSERT INTO tt VALUES ("山东省", "济南市", "程六")
INSERT INTO tt VALUES ("山东省", "济南市", "赵奇")
CREATE CURSOR tj (省份 C(10), 城市 C(10), 员工 C(254))
INDEX on 省份+城市 TAG 省市
SELECT tt
SET RELATION TO 省份+城市 INTO "tj"
SCAN
IF FOUND("tj")
REPLACE tj.员工 WITH tj.员工-"、"-tt.员工
ELSE
INSERT INTO tj VALUES (tt.省份, tt.城市, tt.员工)
ENDIF
ENDSCAN
SET RELATION TO
SELECT tj
BROWSE