List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:July 9 2002 8:35pm
Subject:Re: Basic Q's: Numerical Sorting
View as plain text  
In the last episode (Jul 09), CVIOG at UGA said:
> I have a fairly basic question: How do I sort
> numerically?  Normally when I query using "ORDER BY
> (field)", it orders by the first digit (i.e. 1, 10, 2,
> 21, 3, 32) rather than by number (1, 2, 3, 10, 21,
> 32).

Either alter the table to make that field an INTEGER column, or "ORDER
BY field+0" to force mysql to internally convert the field to a number
before sorting.

-- 
	Dan Nelson
	dnelson@stripped
Thread
Basic Q's: Numerical SortingCVIOG at UGA9 Jul
  • Re: Basic Q's: Numerical SortingSerge Paquin9 Jul
  • Re: Basic Q's: Numerical SortingDan Nelson9 Jul
RE: Basic Q's: Numerical SortingLuc Foisy9 Jul