select distinct; a.Fld1,; a.Fld2,; b.Fld3,; c.Fld4,; c.Fld5; From; Dodah a,; Blah b,; Big c; where; a.KeyFld1 = b.KeyFld1; AND a.KeyFld1 = c.KeyFld1; order by; a.Fld1,; b.Fld3,; c.Fld4; into; cursor C_DistinctSampleSetYour sample fields / tables illustrated ok to some point, but hopefully, you follow the above SQL. I don't know what your REAL join key columns are, but you SHOULD be able to substitute accordingly.