<pre>SELECT Numero, MAX(OrderMain) SortOrd FROM Temp ; >GROUP BY Numero ; >ORDER BY SortOrd ; >INTO CURSOR Temp2If it doesn't, can you provide more info about data you're processing and result you want.
INDEX ON STR(OrderMain)+STR(NoCat)+STR(NoThread)+STR(NoParent) TAG OrderMainI simply simulated the bug by using a more simpler SQL.