程序代码:
CREATE CURSOR a1 (序号 n(1), 姓名 c(10), 编号 n(1))
INSERT INTO a1 VALUES (1, "a1", 1)
INSERT INTO a1 VALUES (2, "a2", 2)
INSERT INTO a1 VALUES (3, "a3", 3)
INSERT INTO a1 VALUES (4, "a4", 4)
INSERT INTO a1 VALUES (5, "a5", 5)
CREATE CURSOR b1 (序号 n(1), 姓名 c(10), 编号 n(1))
INSERT INTO b1 VALUES (1, "a5", 0)
INSERT INTO b1 VALUES (2, "a2", 0)
INSERT INTO b1 VALUES (3, "a2", 0)
INSERT INTO b1 VALUES (4, "a2", 0)
INSERT INTO b1 VALUES (5, "a4", 0)
INSERT INTO b1 VALUES (6, "a4", 0)
INSERT INTO b1 VALUES (7, "a1", 0)
INSERT INTO b1 VALUES (8, "a1", 0)
INDEX on 姓名 TAG xm
SELECT a1
SET RELATION TO 姓名 INTO b1 && 姓名必须唯一
SET SKIP TO b1
REPLACE b1.编号 WITH a1.编号 ALL
SET RELATION TO
SET SKIP TO
SELECT b1
SET ORDER TO
BROWSE