MySQL Forums
Forum List  »  Newbie

Re: BINARY operator not working properly
Posted by: Peter Brawley
Date: July 04, 2013 08:47PM

> column "price" is a float.

Try this:

drop table if exists t;
create table t(price float);
insert into t values(1.1);
select * from t where price=1.1; --> Empty set

The stored float <> 1.1. That's normal for floats. Use decimal for money.

Options: ReplyQuote


Subject
Written By
Posted
Re: BINARY operator not working properly
July 04, 2013 08:47PM


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.