Ok, I think I will do the sorting in perl since the total number ofrows can be sucked into mem in my application...
Dirk