First threee of a group of the same mailcode, I assume. Then by which order, first three requires an order to tell what's the first three in some specific order.
If you mean by physical order, then the straight forward xbase code would be
Code:
* determine all unique mailcodes
SELECT DISTINCT MAILCODE as mailcode from yourtable INTO CURSOR mailcodes
* go through each of them
SELECT yourtable
SET ORDER TO mailcode
SELECT mailcodes
SCAN
SELECT yourtable
SET KEY TO mailcodes.mailcode
SCAN NEXT 3
*do whatever - mark records as found/relevant, process them
ENDSCAN
ENDSCAN