Re: Complex query

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: "Leonardo M(dot) Ramé" <l(dot)rame(at)griensu(dot)com>, PostgreSql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Complex query
Date: 2014-03-31 18:49:58
Message-ID: 5339B8D6.2040806@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)iol(dot)ie

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Leonardo M. Ramé 2014-03-31 18:55:42 Re: Complex query
Previous Message Moshe Jacobson 2014-03-31 18:49:46 Wanted: ALTER TRIGGER ... OWNED BY EXTENSION