Re: MAX() Function
Posted in 2003
p_bid is a character string! If you sort character strings they come out in that order as well. Why not make p_bid a decimal datatype. After all it is a number. Malcolm ----- Original Message ----- From: "Dave Hill" <dhill@mprc.co.uk> To: <informix-list@iiug.org> Sent: Wednesday, August 13, 2003 8:52 AM Subject: MAX() Function > Hi World, > > Can anybody help and make suggestions why the max function is not > working in my sql? > > select max(p_bid) phonebid > from bid > where batch = $BATCH > into temp t2 with no log; > > What is happening is if a client bids '8 the max function does not > pick up a higher bid until you get to '81!! This is really confusing > me. This is the same no matter if you start with '6 it then wont pick > a bid up as max until '61 etc.. sending to informix-list