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

Поиск
Список
Период
Сортировка
Искать
От
knut.suebert@web.de
Тема
delete other similar entries with timestamp <= timestamp+15min?
Дата
Msg-id
20020730192246.GA6934@web.de
Список
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 по дате отправления
От: Daniel L Banta
Дата:
Сообщение: initdb initialization problem
От: Chad Thompson
Дата:
Сообщение: Very slow query
FAQ