Gary Shea writes:
<cut>
 > 
 > Sorry, this is my fault for not describing the problem better.
 > Here's the result I get with DISTINCT (I've given the columns
 > names to make the table smaller, but not changed the SQL from what
 > I sent in the bug report):
 > 
 > +---+
 > | i |
 > +---+
 > | 1 |
 > | 2 |
 > +---+
 > +---+-----+-----+-----+----------------+
 > | i | vv1 | vv2 | vv3 | @vv1+@vv2+@vv3 |
 > +---+-----+-----+-----+----------------+
 > | 1 |   1 |   0 |   1 |              1 |
 > | 2 |   1 |   0 |   0 |              1 |
 > +---+-----+-----+-----+----------------+
 > 
 > Note that the sum is not correct: the last column values
 > should be 2 and 1, not 1 and 1.  With DISTINCT, the sum
 > value is always correct for the very last row, and the
 > sum value for all other rows is the same as the
 > sum value in the last row!
 > 
 > Here's the result without DISTINCT:
 > 
 > +---+
 > | i |
 > +---+
 > | 1 |
 > | 2 |
 > +---+
 > +---+-----+-----+-----+----------------+
 > | i | vv1 | vv2 | vv3 | @vv1+@vv2+@vv3 |
 > +---+-----+-----+-----+----------------+
 > | 1 |   1 |   0 |   1 |              2 |
 > | 2 |   1 |   0 |   0 |              1 |
 > +---+-----+-----+-----+----------------+
 > 
 > As you can see, the sums are now correct.
 > 
 > After I posted the bug report, I noticed that the same problem
 > occurs if I used ORDER BY.  Probably a hint in there somewhere ;)
 > 
 > Sorry for the poor report!
 > 
 >      Gary
 > 
 > 

Thank you for your report.


Regards,

Sinisa

      ____  __     _____   _____  ___     ==  MySQL AB
     /*/\*\/\*\   /*/ \*\ /*/ \*\ |*|     Sinisa Milivojevic
    /*/ /*/ /*/   \*\_   |*|   |*||*|     mailto:[EMAIL PROTECTED]
   /*/ /*/ /*/\*\/*/  \*\|*|   |*||*|     Larnaca, Cyprus
  /*/     /*/  /*/\*\_/*/ \*\_/*/ |*|____
  ^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^
             /*/             \*\                Developers Team

---------------------------------------------------------------------
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 <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to