Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group