Hi.  I'm new to the list, just installed mysql 4.0.10-gamma on Unix,
BSDI 4.x to take advantage of the new Union command.
I've run across an error & have narrowed it down.  I don't know if this
is correct behavior documented somewhere I can't find, or if it's a bug.
It's an odd error, so, I will try to explain it well without having to
provide the tables & all.  But, let me know if you need more info.
 
Note: My call isn't 2 identical statements, but it is equivalent &
provides the same errors.  This example is provided for clarity.
Note: in this example field acB is unique in table AC, but not in the
return set generated by the join.
 
The following select statement works fine:
(select seA, acB, count(*) from SE left join AC on (seID=acID) group by
seA,acB);
However, doing a UNION of this statement with itself generates a
"Duplicate entry for Key 1" error.  
Removing the acB from either the return or the group fixes this.  The
error only seems to occur when acB is not unique in the return set.  A
similar error is generated with seA in the case of a right join.
I can only assume the duplicate key is generated from the insert into
temporary tables used for grouping.
 
Any feedback would be great.  I really needed the union, & I have to
have the value returned & grouped.  I believe the SQL I've written is
correct; it works beautifully for all cases where the return set of the
grouped field is unique.  If this is a bug, I'd rather wait for it to be
fixed than rewrite it into multiple calls.
 
Thanks in advance,

Wendy


---------------------------------------------------------------------
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