Re: sorting mysql output by date or alphabetically
| From: | Philip Olson | Date: | Wed, 20 Dec 2000 01:22:18 +0000 |
| Subject: | Re: sorting mysql output by date or alphabetically | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-31114@lists.php.net to get a copy of this message | ||
This is SQL, which is "ORDER BY" so :
http://sqlcourse2.com/orderby.html
In this case, you'll be ordering by your data column.
SELECT foo FROM tablename ORDER BY datecolumn , anothercolumn ASC
Depends on your desire, the above link should help your quest. The above
SELECT statement orders by date, then orders columns with same date by
'anothercolumn' in ascending order. :-)
Regards,
Philip
--.sig
[ Want to write Good code? First, write Bad code. ]
On Tue, 19 Dec 2000, enthalpy wrote:
>
> does anyone have any sample code of sorting mysql output by date (newest -
> oldest) and alphabetically.
>
> <-----CoreComm-Internet-Services--http://core.com/----->
> (Jon Marshall CoreComm Services Chicago)
> (jonathon.marshall@core.com Systems Engineer II)
> (enthalpy@core.com Network Operations)
> <-----Enthalpy.org------------http://enthalpy.org/----->
> (enthalpy@enthalpy.org The World of Nothing)
> <------------------------------------------------------>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>