Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (Postfix) with ESMTP id B7F8C475481 for ; Sun, 3 Mar 2002 15:55:50 -0500 (EST) Received: from [209.10.40.250] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.5.2) with HTTP id 815464; Sun, 03 Mar 2002 12:55:49 -0800 From: "Josh Berkus" Subject: Re: - Finding records in sequence To: "John Oakes" Cc: pgsql-sql@postgresql.org X-Mailer: CommuniGate Pro Web Mailer v.3.5.2 Date: Sun, 03 Mar 2002 12:55:49 -0800 Message-ID: In-Reply-To: <001501c1c2e9$6b35a1d0$cb842341@john> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Archive-Number: 200203/31 X-Sequence-Number: 6913 Mr. Oakes, > I have a table with a few columns, one of which is Pass/Fail. I want > to > find the most passes in sequence in the table and the most failures > in > sequence in the table. Is there a function to do this, or will I > need to > create one? Thanks! You'll need to create one. For your sake, I hope that you created the table with either a timestamp or a serial column so that you can determin the sequence of records. Since your problem is procedural rather than set-oriented in nature, you will have an easier time implementing it in a procedural interface language (like Perl or C) than in SQL. -Josh