* Get all custid hat occurs less than 10 times SELECT custid ; FROM orders ; GROUP BY custid ; HAVING CNT(*) < 10 ; INTO CURSOR crsLessThan10 SET ORDER TO custid IN orders SCAN SELECT orders SCAN WHILE custid = crsLessThan10.custid * Do processing ENDSCAN ENDSCAN>Ok here's one for you guys, I want to split out from a table all records where a certain field's value occurs less than say 10 times in the said table.