Hi, without looking into code here there is a possibility sorting records by a list, eg ORDER BY FIELD(pid, '1,5,8,7,9,12,45') If we have the rootline we could create a flat comma list and it woould be possible, maybe worth a try? vg Steffen