delete other similar entries with timestamp <= timestamp+15min?

From: knut(dot)suebert(at)web(dot)de
To: pgsql-novice(at)postgresql(dot)org
Subject: delete other similar entries with timestamp <= timestamp+15min?
Date: 2002-07-30 19:22:46
Message-ID: 20020730192246.GA6934@web.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hello,

I don't know how to do the "pseudo-delete" in the middle:

select * from table order by stamp;

nr | stamp
----+------
1 | 20:45
1 | 20:46
2 | 21:00
1 | 21:03
3 | 22:05
2 | 22:05
1 | 22:06
1 | 22:06

"delete from table where nr is not unique during stamp + '15 minutes';"

which should end in a table like

nr | stamp
----+------
1 | 20:45
2 | 21:00
1 | 21:03
3 | 22:05
2 | 22:05
1 | 22:06

Is that possible in SQL?

Thanks,
Knut Sübert

Browse pgsql-novice by date

  From Date Subject
Next Message Daniel L Banta 2002-07-30 19:33:31 initdb initialization problem
Previous Message Manuel Sugawara 2002-07-30 16:02:33 Re: Changing Database Name