Re: Limit record count

Поиск
Список
Период
Сортировка
От Rodrigo Gonzalez
Тема Re: Limit record count
Дата
Msg-id 4766F72C.5040002@gmail.com
обсуждение исходный текст
Ответ на Limit record count  ("Sean Z." <sean09182006@yahoo.com>)
Список pgsql-general
DELETE FROM <table> WHERE <id> NOT IN (SELECT <id> FROM <table> ORDER BY
<id> DESC LIMIT 50)

Sean Z. escribió:
> Hi,
>
> I need to write a maintenance function to delete oldest records of a
> table, leaving only a certain number of records, say 50.  The task
> should run once per day.  How can I write it?
> The oldest record carries the smallest ID.
>
> Thanks a lot!
> Sean
>
> ------------------------------------------------------------------------
> Never miss a thing. Make Yahoo your homepage.
> <http://us.rd.yahoo.com/evt=51438/*http://www.yahoo.com/r/hs>



Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: "Dave Page"
Дата:
Сообщение: Re: spreadsheet interface
Следующее
От: Greg Smith
Дата:
Сообщение: Re: install problem