From: Date: March 24 2004 4:12pm Subject: Re: How to optimize ugly order by? List-Archive: http://lists.mysql.org/mysql/162426 Message-Id: <011601c411b2$62c931a0$2801a8c0@localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit From: "Henrik Schröder" > used a lot in various searches, and all results should be ordered by > membership type, but the order should not be 0-1-2, but instead 1-2-0. One thing you could do (not very neat IMHO) is to JOIN this query with a table that contains membershiptype and a sortorder. Then you can ORDER BY the sortorder of that table... Regards, Jigal.