Re: MYSQL natsort() ?
| From: | lallous | Date: | Tue, 30 Jul 2002 07:31:25 +0000 |
| Subject: | Re: MYSQL natsort() ? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-110301@lists.php.net to get a copy of this message | ||
Well, you can do something like:
SELECT * FROM tablename
ORDER BY fieldname [ASC|DESC]
=> [ASC|DESC] optional, put either of theses without the brackets.
//Elias.
"Joel Colombo" <joel@graphicon.nu> wrote in message
news:20020729193451.34304.qmail@pb1.pair.com...
> This is a mysql question, cause i can do it with a natsort in php.
> question is can u do it directly in the MYSQL SELECT ?
> I am wondering if the SELECT statement can have a natural order by.
>
> Table has 5 rows.
> field name "number"
> values :
> 10
> 2
> 15
> 30
> 150
>
> a regular order by "number": generates results 10,15,150,2,30
>
> i need a natural sort....
> 2,10,15,30,150
>
> is there a way to sort FLOAT valuse like this using an order by with a
combo
> of other functions or something ?
>
> Thanks
> Joel
>
>
>
>
>
>
>
>