in reply to sorting a database table with primary keys

I may be missing something, but why not just ask the database to sort it in the first place? That would have been a much more useful snippet.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

  • Comment on Re: sorting a database table with primary keys

Replies are listed 'Best First'.
Re^2: sorting a database table with primary keys
by jeremyh (Beadle) on Apr 12, 2006 at 00:59 UTC
    Sometimes it's useful to re-use the data from a DB query (in a different order) without re-executing the query, so it would be handy to sort it locally.

    That's not demonstrated in this example, but I've done this before.

A reply falls below the community's threshold of quality. You may see it by logging in.