Received: from gyw.com (gyw.com [209.55.67.177]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f4SEq0A69475 for ; Mon, 28 May 2001 10:52:00 -0400 (EDT) (envelope-from tjk@tksoft.com) Received: from smtp3.tksoft.com (smtp3.tksoft.com [192.168.50.56] (may be forged)) by gyw.com (8.8.8/8.8.8) with ESMTP id GAA02431; Mon, 28 May 2001 06:52:01 -0700 Received: (from tjk@tksoft.com) by smtp3.tksoft.com (8.8.8/8.8.8) id GAA11700; Mon, 28 May 2001 06:29:15 -0700 From: "tjk@tksoft.com" Message-Id: <200105281329.GAA11700@smtp3.tksoft.com> Subject: Re: SQL specified sort To: morrisonjeffrey@hotmail.com (jeffrey morrison) Date: Mon, 28 May 2001 06:29:15 -0700 (PDT) Cc: pgsql-sql@postgresql.org In-Reply-To: from "jeffrey morrison" at May 25, 2001 02:29:01 PM X-Info: None MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200105/297 X-Sequence-Number: 3138 Jeff, If you want to receive your data in an order which you specify manually, the easiest way to accomplish this is to add a separate field which contains an int4 value used by you to specify the order. E.g. myval | sortint _____________________ H29 | 2 214 | 1 200 | 3 099 | 4 SELECT myval FROM mytable ORDER BY sortint; Troy > > I was wondering if you could help me out with a problem I'm having. Say for > example I have data coming out like: > H29 > 214 > 200 > 099 > > How would I use a sort to be able to make the output look like > > 214 > H29 > 200 > 099 > > I don't believe their is a way to do an ORDER BY in a specific order. Any > help you could give me this problem would be very much appreciated. > > Jeff Morrison > _________________________________________________________________________ > Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster >