From: Dan Nelson Date: January 31 2004 12:09am Subject: Re: ORDER BY may remove result rows List-Archive: http://lists.mysql.com/mysql/158757 Message-Id: <20040131000916.GB4260@dan.emsphone.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In the last episode (Jan 30), lknecht@stripped said: > >Description: > Instead of ordering rows, ORDER BY may remove rows ... > mysql> SELECT Id3 FROM T WHERE Id2=2 AND Val BETWEEN -30 AND 20 ORDER BY Id3; > +-----+ > | Id3 | > +-----+ > | 3 | > +-----+ > 1 row in set (0.01 sec) > > Note: both indices Key2 and Key3 must be present for the bug to occur. I see this too. Even more fun: mysql> SELECT Id3 FROM T WHERE Id2=2 AND Val BETWEEN -30 AND 20 ORDER BY Id3 DESC; Empty set (0.00 sec) -- Dan Nelson dnelson@stripped