From: | Joseph Shraibman <jks(at)selectacast(dot)net> |
---|---|
To: | Richard Huxton <dev(at)archonet(dot)com> |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: select by streak |
Date: | 2001-06-21 19:04:21 |
Message-ID: | 3B324535.FF89D8D0@selectacast.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Richard Huxton wrote:
>
> From: "Joseph Shraibman" <jks(at)selectacast(dot)net>
>
> > Lets say I have a table like this:
> >
> > id int <== primary key
> > ts timestamp
> > name text
> > status char
> >
> > status is G for good or B for bad. How do I do something like:
> > SELECT name FROM mytable WHERE <last 3 entires in a row have status =
> > 'B'> and <has been no good ones in the past week> ?
>
> You're looking at a procedural solution here rather than SQL I'd suspect.
> Either do this in your application or look into plpgsql or pltcl.
That's what I was afraid of :(
--
Joseph Shraibman
jks(at)selectacast(dot)net
Increase signal to noise ratio. http://www.targabot.com
From | Date | Subject | |
---|---|---|---|
Next Message | Marc Sherman | 2001-06-21 19:27:03 | RE: Select most recent record? |
Previous Message | Alain Lavigne | 2001-06-21 18:10:31 | Re: Changing PL/pgSQL triggers |