Re: delete other similar entries with timestamp <= times

From: "'knut(dot)suebert(at)web(dot)de'" <knut(dot)suebert(at)web(dot)de>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: delete other similar entries with timestamp <= times
Date: 2002-08-02 17:59:51
Message-ID: 20020802175950.GA22007@web.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Adam Erickson 2002-08-02 18:20:34 Aggregates and Indexes
Previous Message James Kelty 2002-08-02 17:45:30 Replication