Page 1 of 1

SQL: max() and min() return strange values

Posted: Mon Mar 13, 2006 2:16 pm
by ^rooker
[PROBLEMS]
I wanted to get the maximum and minimum values of a field containing numbers in an SQL database, but when I did a

Code: Select all

SELECT max(value) FROM myTable
I received very strange results:

the maximum was: -9.2718491
and the minimum was -0.372839

Apart from being upside down, there were values in that table ranging downto -17.


[SOLUTION]
The "value" field was a VARCHAR and not a numeric type.