Fw: [PHP] MYSQL natsort() ?

2002-07-29 Thread Kevin Stone

I know that MySQL will do a natural sort on INT fields becuase I often use
an integer for my index.  But I don't know about a FLOAT field.   Seems like
it should doesn't it?  Sorry I don't have a direct answer for you.  You
might want to check www.mysql.com if you haven't already.
-Kevin

- Original Message -
From: "Joel Colombo" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 29, 2002 1:27 PM
Subject: [PHP] MYSQL natsort() ?


> 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
>
>
>
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




[PHP] MYSQL natsort() ?

2002-07-29 Thread Joel Colombo

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









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