Re: Complex query - Mailing list pgsql-general

From Raymond O'Donnell
Subject Re: Complex query
Date
Msg-id 5339B8D6.2040806@iol.ie
Whole thread Raw
In response to Complex query  (Leonardo M. Ramé <l.rame@griensu.com>)
List pgsql-general
On 31/03/2014 19:38, Leonardo M. Ramé wrote:
> Hi, I'm looking for help with this query.
>
> Table Tasks:
>
> IdTask  StatusCode  StatusName
> ----------------------------------
> 1       R           Registered
> 1       S           Started
> 1       D           Dictated
> 1       F           Finished
> 1       T           Transcribed
> ----------------------------------
> 2       R           Registered
> 2       S           Started
> 2       T           Transcribed
> 2       F           Finished
>
> As you can see, I have a table containing tasks and statuses. What I
> would like to get is the list of tasks, including all of its steps, for
> only those tasks where the StatusCode sequence was S followed by T.

How do you know the sequence in which the statuses occurred? Is there
another column with a timestamp or something?

Ray.


--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie


pgsql-general by date:

Previous
From: Igor Neyman
Date:
Subject: Re: Complex query
Next
From: Moshe Jacobson
Date:
Subject: Wanted: ALTER TRIGGER ... OWNED BY EXTENSION