CREATE CURSOR phones (phone C(12)) INSERT INTO phones VALUES ('11111') INSERT INTO phones VALUES ('22222') INSERT INTO phones VALUES ('33333') INSERT INTO phones VALUES ('44444') INSERT INTO phones VALUES ('55555') INSERT INTO phones VALUES ('66666') INSERT INTO phones VALUES ('77777') SELECT DISTINCT; p1.phone, p2.phone, p3.phone, p4.phone, p5.phone,; p6.phone, p7.phone; FROM phones p1, phones p2, phones p3, phones p4, phones p5,; phones p6, phones p7; WHERE p1.phone <> p2.phone; AND p2.phone <> p3.phone; AND p3.phone <> p4.phone; AND p4.phone <> p5.phone; AND p5.phone <> p6.phone; AND p6.phone <> p7.phoneWHERE clause above is incomplete. Technically it must cover condition "each column value is not equal to any other column value). The way is not optimal. With number of records more than 10 it will freeze any computer for long time.