[GENERAL] updating rows which have a common value forconsecutive dates

2011-04-13 Thread Lonni J Friedman
Greetings, I have a table full of automated test data, which continuously has new unique data inserted: Column |Type | Modifiers +-+- id | integer

Re: [GENERAL] updating rows which have a common value forconsecutive dates

2011-04-13 Thread David Johnston
- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Lonni J Friedman Sent: Wednesday, April 13, 2011 3:34 AM To: pgsql-general Subject: [GENERAL] updating rows which have a common value forconsecutive dates Greetings, I have a table full of automated tes

Re: [GENERAL] updating rows which have a common value forconsecutive dates

2011-04-13 Thread Lonni J Friedman
then use rank() to number each test run > sequentially.  Then you can limit the results to  ( rank() <= 2 AND > current_status = 'FAILED' ). > > David J. > > -Original Message- > From: pgsql-general-ow...@postgresql.org > [mailto:pgsql-general-ow...@postgres

Re: [GENERAL] updating rows which have a common value forconsecutive dates

2011-04-13 Thread David Johnston
; current_status = 'FAILED' ). >> >> David J. >> >> -Original Message- >> From: pgsql-general-ow...@postgresql.org >> [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Lonni J Friedman >> Sent: Wednesday, April 13, 2011 3:3

Re: [GENERAL] updating rows which have a common value forconsecutive dates

2011-04-14 Thread Lonni J Friedman
t;> >> On Wed, Apr 13, 2011 at 9:57 AM, David Johnston wrote: >>> If you have the ability to use Window functions you can group (as >>> necessary), order by last_update, and then use rank() to number each test >>> run sequentially.  Then you can limit the res