[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Limiting to specific field value of type float


Alec

Exact matches on float values are notoriously unreliable - the problem with
the math is that it can often turn out the value at something like :-

123.539999999999999999999999999999999999999

which won't produce an equality match.

For this you would probably better use a DECIMAL field.

Andy

----- Original Message -----
From: "Alec Solway" <alec20@xxxxxxxxxxxx>
To: <mysql@xxxxxxxxxxxxxxx>
Sent: Saturday, March 03, 2001 6:51 PM
Subject: Limiting to specific field value of type float


> Hi,
>
> I'm having some trouble with the following:
>
> I have a sample table that has one record where price == 123.54, however
>
> select * from gpl where price=123.54
>
> returns an empty set. If I set price to an integer value that's also in
the
> table, it works. e.g.
>
> select * from gpl where price=500
>
> returns the proper results. price is a column of type float.
>
> TIA.
> Alec Solway
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <mysql-thread67311@xxxxxxxxxxxxxxx>
> To unsubscribe, e-mail
<mysql-unsubscribe-andy=eaccountable.com@xxxxxxxxxxxxxxx>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <mysql-thread67346@xxxxxxxxxxxxxxx>
To unsubscribe, e-mail <mysql-unsubscribe-treed=ultraviolet.org@xxxxxxxxxxxxxxx>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



This mailing list archive is a service of Copilot Consulting.