Thread: - Finding records in sequence

- Finding records in sequence

From
"John Oakes"
Date:
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!

John Oakes




Re: - Finding records in sequence

From
"Josh Berkus"
Date:
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 thetable with either a timestamp or a serial column
sothat you candetermin 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
proceduralinterfacelanguage (like Perl or C) than in SQL.
 

-Josh