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

Linux howto's, compile information, information on whatever we learned on working with linux, MACOs and - of course - Products of the big evil....
Post Reply
User avatar
^rooker
Site Admin
Posts: 1483
Joined: Fri Aug 29, 2003 8:39 pm

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

Post 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.
Post Reply