> Some self join would work best I suppose:
>
> select p.*, c.*
> from collection p, collection.c
> where c.parent_id = p.collectionid
> order by p.collectionid ASC, c.collectionid
>
> Depending on your datset you might need to use an outer join instead.
>
> Jochem
Thanks Jochem! This is almost exactly what I needed, and it's much
cleaner than the ugly monster I started with! My biggest problem was
that parent rows had a parent_id of -1, when they needed a parent_id of
collection_id to sort correctly.
eric