Hi, Yesterday I encounter a silly problem: I wanna get the max value of UserID, and try the MAX function, like this SELECT MAX(userid) AS max FROM usertable; Code (markup): But the MAX function always returns 99, not the highest value (about 200+). Tried google, and I found nothing After that, I think there's some error with the data type, as the MAX is used for number only. Then, I changed the data type from VARCHAR to INT, and all works So, I made a post and hope this will help someone
Is there a problem with using an INT field vs. a VARCHAR? The max or any other comparison function will not work properly on a non numerical field.