MySQL Forums
Forum List  »  Newbie

Sort Not Handling Negative Numbers Correctly
Posted by: Alan Northam
Date: May 18, 2005 09:08AM

In the table in my database I have a column of numbers ranging from -3.3 to 7.1. When I sort the column using (SELECT * FROM mytable ORDER BY mytable;) the column gets sorted as follows: -1.9, -3.3, 1.7, 2.2, 7.1 I streamlined the list as there are actually over 500 numbers between -3.3 and 7.1. The problem I am having is that when I SORT mysql is recognizing -1.9 as a smaller number than -3.3.

When I try to find the minimum number in the column using (SELECT MIN(mycolumn) FROM mytable;) mysql also displays -1.9 as the minimum number.

Is this a known problem with mysql or am I doing something wrong?

Thanks for your help in advance,
Alan

-

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.