Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id A47709FC04E for ; Thu, 26 Apr 2007 21:35:47 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 42355-01 for ; Thu, 26 Apr 2007 21:35:47 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from rrr3-v1.mail.re4.yahoo.com (rrr3-v1.mail.re4.yahoo.com [216.39.53.204]) by postgresql.org (Postfix) with SMTP id C835B9FC048 for ; Thu, 26 Apr 2007 21:35:46 -0300 (ADT) Received: (qmail 30359 invoked from network); 27 Apr 2007 00:35:44 -0000 Received: from web54315.mail.yahoo.com (206.190.49.125) by rrr3-v1.mail.re4.yahoo.com with SMTP; 27 Apr 2007 00:35:44 -0000 Received: (qmail 67982 invoked by uid 60001); 27 Apr 2007 00:35:44 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=wqUC9e0i1iU4tcVIKeoiiQoVMgsIH39gUZ8HcCWp/pLwLwxcQCD63JIQmzvS5fn6f/+UmyhGbFXyRf5iTAQ24/vBkr/PPNfQSPtx7rU56sJZCAiiqtn8y4Iw19T4jW8nnLKRo39PwTVc7m5KO98+zg8RQGRC3owMSlJlinFIIuo=; X-YMail-OSG: RjWY1IEVM1mBWZFxBuD9JKsccAtxvhIyyMhw0t4t9M0iKNq97wgBNkDrV8plhTVG7Hd9W_kOEnjv2TibIy3Dm6hVpqE1D0ZN9CERbgVGC_03Ke3NBHUNmQCTp3snAk2sfhYgG6i.p98Qhalk_Omd0Rxf Received: from [24.2.63.115] by web54315.mail.yahoo.com via HTTP; Thu, 26 Apr 2007 17:35:43 PDT Date: Thu, 26 Apr 2007 17:35:43 -0700 (PDT) From: chester c young Subject: Re: Selecting rows with "static" ordering To: Steve Midgley Cc: sql pgsql In-Reply-To: <20070427001004.B5F5D9FBABA@postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <1266.67652.qm@web54315.mail.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/271 X-Sequence-Number: 28271 > them in the order they are currently stored in that variable. So take > > for example this foreign application variable: > > ids = "3,2,5,1,4" kludgy, but: 1. store your ids in a pg array 2. select from the array 3. on order by, write a function that takes the row.id and array as parameters, returning the id offset into the array __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com