MySQL Forums
Forum List  »  Newbie

max problem
Posted by: JOHN FARRUGIA
Date: May 20, 2005 07:27AM

I have a table that is as follows:
id int,reference varchar(20),value varchar(20),readtime timestamp

I am trying to query the table as follows:
Select reference,max(value) from data_readings.lts5

the value that is returned is not the max value. I would asume its because the value is in varchar format. Should I convert it to an int format before I use this query? If so, how do I do this without altering the table?

Options: ReplyQuote


Subject
Written By
Posted
max problem
May 20, 2005 07:27AM


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.