Received: from hedley.blazingcactus.com (IDENT:root@blazingcactus.com [63.197.67.194]) by hub.org (8.9.3/8.9.3) with ESMTP id TAA52255 for ; Wed, 12 Apr 2000 19:33:15 -0400 (EDT) (envelope-from ian@blazingcactus.com) Received: (from nobody@localhost) by hedley.blazingcactus.com (8.9.3/8.9.3) id QAA05037; Wed, 12 Apr 2000 16:31:18 -0700 Date: Wed, 12 Apr 2000 16:31:18 -0700 Message-Id: <200004122331.QAA05037@hedley.blazingcactus.com> X-Authentication-Warning: hedley.blazingcactus.com: nobody set sender to ian@blazingcactus.com using -f From: Ian McWilton To: pgsql-sql@postgresql.org Reply-To: Ian McWilton MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit User-Agent: IMP/PHP3 Imap webMail Program 2.0.11 X-Originating-IP: 138.42.1.254 Subject: ORDER BY using specifc values X-Archive-Number: 200004/134 Hi there, I need to return the results of a SELECT ordered by a column but in a way that is neither ascending or descending. The ORDER BY column can have one of five values and I want to specify which values are returned in the list in which order. An example table below shows the data in the DB: INDEX | VALUE 1, A 2, B 3, B 4, C 5, B ...and what I want is for my queries result to be ordered by VALUE with C put first in the list, then A, then B. Having investigated it appears that ORDER BY does not seem to be any help as it restricts the ordering to ASC or DESC. The onyl solution I can see isn't at all elegant; issue five SELECT statements in sequence and construct one list from this five Does anyone know of another way to do what I want in one query? Regrads, Ian McWilton.