Re: Some insight on the proper SQL would be appreciated

Поиск
Список
Период
Сортировка
От Tim Landscheidt
Тема Re: Some insight on the proper SQL would be appreciated
Дата
Msg-id m3y6epdpa5.fsf@passepartout.tim-landscheidt.de
обсуждение исходный текст
Ответ на Re: Some insight on the proper SQL would be appreciated  (Andy Colson <andy@squeakycode.net>)
Список pgsql-general
Andy Colson <andy@squeakycode.net> wrote:

>> thanks very much Andy. Very elegant.

>> I do need to presere the users that have<5 entries though, so I think I can
>> modify your function to do that as well.

> Oh, duh!  because nothing is less than 1900-01-01...  my
> date math sucks.  It should probably return '2100-01-01' or
> something.

If you're using stored functions, you could (and should be-
cause the whole table is probably read anyhow) also code a
function that reads all entries, resets a counter at the
start and whenever the user changes, increments it on every
row and returns all rows where the counter is less than
five.

Tim

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

Предыдущее
От: Vick Khera
Дата:
Сообщение: Re: Queues Problem
Следующее
От: John Gage
Дата:
Сообщение: Re: Cognitive dissonance