select by streak - Mailing list pgsql-sql

From Joseph Shraibman
Subject select by streak
Date
Msg-id 3B30FB0A.3595CD79@selectacast.net
Whole thread Raw
List pgsql-sql
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> ?

-- 
Joseph Shraibman
jks@selectacast.net
Increase signal to noise ratio.  http://www.targabot.com


pgsql-sql by date:

Previous
From: Frank Bax
Date:
Subject: Re: Help on a sql querry.
Next
From: "Matteo Centenaro"
Date:
Subject: Limit and insert