List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:November 12 2001 8:08pm
Subject:Re: Natural Sort
View as plain text  
In the last episode (Nov 12), Michael Kedl said:
> > Looking thru the MYSQL archives I see a few people had interest in
> > a "natural sort" method to sort text fields containing numbers.  I
> > to would like this feature.  Has anything been done for this?
> >
> > Currently sorts text like:
> > 1200 - A tale of 3 dogs
> > 3 bright lights go on
> >
> > "Should be":
> > 3 bright lights go on
> > 1200 - A tale of 3 dogs

Try "... ORDER BY textfield+0", which will force mysql to convert the
field to a number before sorting.

-- 
	Dan Nelson
	dnelson@stripped
Thread
Natural SortMichael Kedl12 Nov
  • Re: Natural SortDan Nelson12 Nov
Re: Natural SortDan Nelson12 Nov