From: Date: March 25 2004 7:54pm Subject: Re: How to optimize ugly order by? List-Archive: http://lists.mysql.org/mysql/162533 Message-Id: <200403251854.i2PIsro7020506@ms-smtp-03-eri0.texas.rr.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit On 24-Mar-2004 Henrik Schröder wrote: > No, I did not choose the sort order. No, I can not change the values > used. > Yes, it has to be this sort order. :-) > Best would be to use ENUM( '1','2','0') ... But otherwise -- (membershiptype % 2) DESC, membershiptype DESC -- or -- ELT(membershiptype + 1, '2', '0', '1') ASC -- or -- MAKE_SET(membershiptype, 'a','b') DESC Regards -- Don Read dread@stripped -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it.