Bluehost.com Web Hosting $6.95

sorting alphanum colum ..

This is a discussion on sorting alphanum colum .. within the MySQL Database forums, part of the Database Forums category; happy visitors of Paris know about the 'arrondissement', an administrative division of the city... 20 selecting them from a city ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-20-2006
Josselin
 
Posts: n/a
Default sorting alphanum colum ..

happy visitors of Paris know about the 'arrondissement', an
administrative division of the city... 20
selecting them from a city database brings them as

'Paris 1' , 'Paris 10' , 'Paris 11' , ..... 'Paris 19' , 'Paris 2' ,
'Paris 20' , 'Paris 3' , .... 'Paris 9'

is there any way to get them ordered as :
'Paris 1' , 'Paris 2' , 'Paris 3' , .... 'Paris 9' , 'Paris 10' ,
'Paris 11' , ..... 'Paris 19' , 'Paris 20'

if not I'll sort the results after selection... :-(((

thanks for your lights

joss


Reply With Quote
  #2 (permalink)  
Old 12-20-2006
strawberry
 
Posts: n/a
Default Re: sorting alphanum colum ..


Josselin wrote:

> happy visitors of Paris know about the 'arrondissement', an
> administrative division of the city... 20
> selecting them from a city database brings them as
>
> 'Paris 1' , 'Paris 10' , 'Paris 11' , ..... 'Paris 19' , 'Paris 2' ,
> 'Paris 20' , 'Paris 3' , .... 'Paris 9'
>
> is there any way to get them ordered as :
> 'Paris 1' , 'Paris 2' , 'Paris 3' , .... 'Paris 9' , 'Paris 10' ,
> 'Paris 11' , ..... 'Paris 19' , 'Paris 20'
>
> if not I'll sort the results after selection... :-(((
>
> thanks for your lights
>
> joss


Remove 'Paris' from the arrondissement field

Reply With Quote
  #3 (permalink)  
Old 12-20-2006
Good Man
 
Posts: n/a
Default Re: sorting alphanum colum ..

"strawberry" <zac.carey@gmail.com> wrote in news:1166629014.665983.254180
@i12g2000cwa.googlegroups.com:

>
> Josselin wrote:
>
>> happy visitors of Paris know about the 'arrondissement', an
>> administrative division of the city... 20
>> selecting them from a city database brings them as
>>
>> 'Paris 1' , 'Paris 10' , 'Paris 11' , ..... 'Paris 19' , 'Paris 2' ,
>> 'Paris 20' , 'Paris 3' , .... 'Paris 9'
>>
>> is there any way to get them ordered as :
>> 'Paris 1' , 'Paris 2' , 'Paris 3' , .... 'Paris 9' , 'Paris 10' ,
>> 'Paris 11' , ..... 'Paris 19' , 'Paris 20'
>>
>> if not I'll sort the results after selection... :-(((
>>
>> thanks for your lights
>>
>> joss

>
> Remove 'Paris' from the arrondissement field


and make the arrondissement field a numeric field (unsigned 'mediumint'
will probably do)
Reply With Quote
  #4 (permalink)  
Old 12-21-2006
Michael Austin
 
Posts: n/a
Default Re: sorting alphanum colum ..

Good Man wrote:

> "strawberry" <zac.carey@gmail.com> wrote in news:1166629014.665983.254180
> @i12g2000cwa.googlegroups.com:
>
>
>>Josselin wrote:
>>
>>
>>>happy visitors of Paris know about the 'arrondissement', an
>>>administrative division of the city... 20
>>>selecting them from a city database brings them as
>>>
>>>'Paris 1' , 'Paris 10' , 'Paris 11' , ..... 'Paris 19' , 'Paris 2' ,
>>>'Paris 20' , 'Paris 3' , .... 'Paris 9'
>>>
>>>is there any way to get them ordered as :
>>>'Paris 1' , 'Paris 2' , 'Paris 3' , .... 'Paris 9' , 'Paris 10' ,
>>>'Paris 11' , ..... 'Paris 19' , 'Paris 20'
>>>
>>>if not I'll sort the results after selection... :-(((
>>>
>>>thanks for your lights
>>>
>>>joss

>>
>>Remove 'Paris' from the arrondissement field

>
>
> and make the arrondissement field a numeric field (unsigned 'mediumint'
> will probably do)


or modify your data 'Paris 1', 'Paris 11' or 'Paris 001', 'Paris 011', Paris 100'

--
Michael Austin.
Database Consultant
Reply With Quote
  #5 (permalink)  
Old 12-21-2006
Josselin
 
Posts: n/a
Default Re: sorting alphanum colum ..

On 2006-12-20 16:36:54 +0100, "strawberry" <zac.carey@gmail.com> said:

>
> Josselin wrote:
>
>> happy visitors of Paris know about the 'arrondissement', an
>> administrative division of the city... 20
>> selecting them from a city database brings them as
>>
>> 'Paris 1' , 'Paris 10' , 'Paris 11' , ..... 'Paris 19' , 'Paris 2' ,
>> 'Paris 20' , 'Paris 3' , .... 'Paris 9'
>>
>> is there any way to get them ordered as :
>> 'Paris 1' , 'Paris 2' , 'Paris 3' , .... 'Paris 9' , 'Paris 10' ,
>> 'Paris 11' , ..... 'Paris 19' , 'Paris 20'
>>
>> if not I'll sort the results after selection... :-(((
>>
>> thanks for your lights
>>
>> joss

>
> Remove 'Paris' from the arrondissement field


thanks fya but over 40'000 cities in the table only 3 have
arrondissements (Paris -> 20, Marseille -> 16 and Lyon -> 9)
which is a very very low percentage...
I assume thet tah solution is sorting raw SQL output in an array , Ruby
can do that easily...

joss

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 03:09 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0