Received: from hotmail.com (f93.law7.hotmail.com [216.33.237.93]) by hub.org (8.9.3/8.9.3) with SMTP id HAA15475 for ; Wed, 12 Jan 2000 07:53:35 -0500 (EST) (envelope-from albertsql@hotmail.com) Received: (qmail 51886 invoked by uid 0); 12 Jan 2000 12:53:04 -0000 Message-ID: <20000112125304.51884.qmail@hotmail.com> Received: from 202.188.228.118 by www.hotmail.com with HTTP; Wed, 12 Jan 2000 04:53:04 PST X-Originating-IP: [202.188.228.118] From: "Albert Loo" To: pgsql-sql@postgresql.org Subject: Re: [SQL] query to do a backward 'skip' ...thanks, it's working. Date: Wed, 12 Jan 2000 20:53:04 MYT Mime-Version: 1.0 Content-Type: text/plain; format=flowed hi, Thanks Tom Lane, Alain Tesio and Hiroshi Inoue for the advise and patch. I've downloaded the latest snapshot with backward scan optimized (that's ok as I'm still testing). I'm still thinking (xbase) a lot of go top, go bottom, skip..skip... :) >>=> select * from mytable where id < '12345' order by id desc limit 1; >>- which returned the correct result '12344', but without optimization. >6.5.* doesn't know how to do that using an index (but 7.0 will). Albert ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com