On Fri, Mar 09, 2001 at 08:13:24AM -0600, Gerald L. Clark wrote:
> I think you meant
> select sum(deci) as s where deci<0;
> > select sum(deci) as s from deci having s<0;
No, I really meant my SELECT. MySQL counted the 3 values together but
instead of coming to the conclusion that the sum is zer
I think you meant
select sum(deci) as s where deci<0;
Christian Hammers wrote:
>
> Hello
>
> CREATE TABLE deci (deci decimal(8,2));
> INSERT INTO deci VALUES (-2427.88);
> INSERT INTO deci VALUES (2427.89);
> INSERT INTO deci VALUES (-0.01);
> select sum(deci) as s from deci having s<0;
> +---
On 09.03.2001 10:29:28 Christian Hammers wrote:
> Is this a bug or is the decimal type just evil or how should *I* behave
> when having such a table?
If I'm not mistaken, then decimal is handled internally like a float. And as
such, problems like yours are really expected, because there simply
Hello
CREATE TABLE deci (deci decimal(8,2));
INSERT INTO deci VALUES (-2427.88);
INSERT INTO deci VALUES (2427.89);
INSERT INTO deci VALUES (-0.01);
select sum(deci) as s from deci having s<0;
+---+
| s |
+---+
| -0.00 |
+---+
Well for the values given above - monetary values - t