Re: delete other similar entries with timestamp <= times - Mailing list pgsql-novice

From 'knut.suebert@web.de'
Subject Re: delete other similar entries with timestamp <= times
Date
Msg-id 20020802175950.GA22007@web.de
Whole thread Raw
In response to Re: delete other similar entries with timestamp <= times  ("Henshall, Stuart - WCP" <SHenshall@westcountrypublications.co.uk>)
List pgsql-novice
Henshall, Stuart - WCP schrieb:
>    Hello,
>            How about something like:
>    DELETE FROM tbl WHERE EXISTS
>            (SELECT * FROM tbl AS tbl_b WHERE tbl_b.nr=tbl.nr
>                    AND tbl_b.stamp<tbl.stamp AND
>                    tbl_b.stamp>=tbl.stamp-CAST('15 minute' AS interval));
>    This may have a problem with the following however:
>            nr | stamp
>            ---+------
>             1 | 20:45
>             1 | 20:55
>             1 | 21:05
>    I am unsure wether this will leave just the 20:45 case or be indeterminate
>    (with the alternate leaving the 20:45 and 21:05 entry)

That does not care a very lot in my case - but thanks a lot,
Knut Sübert

pgsql-novice by date:

Previous
From: "James Kelty"
Date:
Subject: Re: Replication
Next
From: Josh Berkus
Date:
Subject: Re: Aggregates and Indexes