select by streak

From: Joseph Shraibman <jks(at)selectacast(dot)net>
To: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: select by streak
Date: 2001-06-20 19:35:38
Message-ID: 3B30FB0A.3595CD79@selectacast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)selectacast(dot)net
Increase signal to noise ratio. http://www.targabot.com

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message sbelow 2001-06-20 19:37:39 firehouse
Previous Message George Moga 2001-06-20 19:23:11 Re: set datestyle to European PROBLEM