delete other similar entries with timestamp <= timestamp+15min? - Mailing list pgsql-novice

From knut.suebert@web.de
Subject delete other similar entries with timestamp <= timestamp+15min?
Date
Msg-id 20020730192246.GA6934@web.de
Whole thread Raw
List 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

pgsql-novice by date:

Previous
From: "Daniel L Banta"
Date:
Subject: initdb initialization problem
Next
From: "Chad Thompson"
Date:
Subject: Very slow query