Mike,

> example birthday=1972/02/14
> How do i tell mysql to order by the day (14) only so that I can list
same
> birthday in a month in acending order.

If your birthdays are stored in a DATE column, your example would be
"1972-02-14". In this case, you can use the date functions of MySQL.
Here are some examples (my table datum has only one column named datum,
type DATE:

mysql> SELECT * FROM datum ORDER BY DAYOFMONTH(datum);
+------------+
| datum      |
+------------+
| 2002-02-08 |
| 2003-02-08 |
| 1964-12-17 |
| 1958-08-29 |
+------------+
4 rows in set (0.02 sec)

mysql> SELECT * FROM datum ORDER BY MONTH(datum), DAYOFMONTH(datum);
+------------+
| datum      |
+------------+
| 2002-02-08 |
| 2003-02-08 |
| 1958-08-29 |
| 1964-12-17 |
+------------+
4 rows in set (0.01 sec)

HTH,
--
  Stefan Hinz <[EMAIL PROTECTED]>
  Geschäftsführer / CEO iConnect GmbH <http://iConnect.de>
  Heesestr. 6, 12169 Berlin (Germany)
  Tel: +49 30 7970948-0  Fax: +49 30 7970948-3

----- Original Message -----
From: "Mike Doanh Tran" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 24, 2003 11:14 PM
Subject: order by birthday not year


> Hi,
>
> I want to use the order by clause to list the birthday field by the
> birthday not year. How do i do this?
> example birthday=1972/02/14
>
> How do i tell mysql to order by the day (14) only so that I can list
same
> birthday in a month in acending order.
>
> Thanks
>
>
>
>
> --
> Mike Doanh Tran
> Shuffle Master Inc.
> Website:  http://internal.shufflemasterrd.com/
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to