Andy Colson <andy@xxxxxxxxxxxxxxx> 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 -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general