Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id F3C6747615F for ; Sun, 5 Jan 2003 07:18:34 -0500 (EST) Received: from web80304.mail.yahoo.com (web80304.mail.yahoo.com [66.218.79.20]) by postgresql.org (Postfix) with SMTP id 3042B4760F5 for ; Sun, 5 Jan 2003 07:18:34 -0500 (EST) Message-ID: <20030105121837.20686.qmail@web80304.mail.yahoo.com> Received: from [202.163.251.190] by web80304.mail.yahoo.com via HTTP; Sun, 05 Jan 2003 04:18:37 PST Date: Sun, 5 Jan 2003 04:18:37 -0800 (PST) From: Ludwig Lim Subject: Re: Deleting in order from a table To: pginfo Cc: PostgreSQL Mailing List In-Reply-To: <3E17FA4B.7F4102B6@t1.unisoftbg.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/30 X-Sequence-Number: 10895 --- pginfo wrote: > I have a table tableA ( ....,order_num int). > > I will to delete some records from tableA but in asc > or desc > order_num-order. > > Is it possible to write delete from tableA where > (some conditions) order > by order_num ? > > Many thanks, > ivan. > Try the following: DELETE FROM tableA WHERE order_num IN ( SELECT order_num FROM tableA ORDER BY order_num LIMIT n OFFSET m); Use LIMIT to determine the number of rows to delete and OFFSET to determine the "starting row". ludwig __________________________________________________ Do you Yahoo!? New DSL Internet Access from SBC & Yahoo! http://sbc.yahoo.com