Ah, the key phrase: you only want to see the first occurrance. Now, do you want to see the first occurrance as it exists in the file? Or is there some other field value that would specify the first occurrance in a file? OK, I haven't tested this, but this in theory should find the first occurrance in a file: Select fielda,fieldb from file F1 where rrn(file)=(Select min(rrn(file)) from file F2 where f2.fielda=f1.fielda having count(*)>1)
If this is a large file, this might be a long running statement. Bill