Hi, The following sql operators caused to incorrect results:
CREATE TEMPORARY TABLE temp_list ( CurrID char(42) NOT NULL, OriginalID char(42) NOT NULL , DocRevision int(16) unsigned NOT NULL ) TYPE=InnoDB; insert into temp_list select CurrID, OriginalID, max(DocRevision) from some_table where DocRevision in (0,1,2,3) group by OriginalID having (sum(deleted) = 0); I revealed that temp_list table contains some incorrect values of CurrID (not matched to found OriginaID and Docrevision). According to Mysql documentation it should work. The values of CurrID is a primary key in some_table. These are the column definitions in some_table (InnoDB): CurrID char(42) NOT NULL, OriginalID char(42) NOT NULL , DocRevision int(16) unsigned NOT NULL . . . I check this in 3.51 and 3.53 and got the same results. Regards, Dmitry This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify us immediately and delete this communication. --------------------------------------------------------------------- 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