Re: Re: Newbie Questions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > "SELECT firstname, lastname, address FROM TABLENAME ORDER BY lastname
ASC";
> >
> > Use ASC or DESC to order your query results. When you
> > iterate over the result as Torsten indicated, everything
> > will be in the order you specify.
>
> In the database table itself, right? Does it make more
> sense to do that than to leave the database alone, read it
> into an array and then sort it anyway I want (there will be
> at least two different sorted lists I want it to produce)?

Sorting in the database should always be the preferred way - should be
quicker than doing it in the application in 9 out of 10 times.

Regards, Torsten Roehr

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux